proteus  1.7.4
C/C++/Fortran libraries
cpartitioning.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.16 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_16"
11 #define CYTHON_HEX_VERSION 0x001D10F0
12 #define CYTHON_FUTURE_DIVISION 0
13 #include <stddef.h>
14 #ifndef offsetof
15  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18  #ifndef __stdcall
19  #define __stdcall
20  #endif
21  #ifndef __cdecl
22  #define __cdecl
23  #endif
24  #ifndef __fastcall
25  #define __fastcall
26  #endif
27 #endif
28 #ifndef DL_IMPORT
29  #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32  #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36  #if PY_VERSION_HEX >= 0x02070000
37  #define HAVE_LONG_LONG
38  #endif
39 #endif
40 #ifndef PY_LONG_LONG
41  #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44  #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47  #define CYTHON_COMPILING_IN_PYPY 1
48  #define CYTHON_COMPILING_IN_PYSTON 0
49  #define CYTHON_COMPILING_IN_CPYTHON 0
50  #undef CYTHON_USE_TYPE_SLOTS
51  #define CYTHON_USE_TYPE_SLOTS 0
52  #undef CYTHON_USE_PYTYPE_LOOKUP
53  #define CYTHON_USE_PYTYPE_LOOKUP 0
54  #if PY_VERSION_HEX < 0x03050000
55  #undef CYTHON_USE_ASYNC_SLOTS
56  #define CYTHON_USE_ASYNC_SLOTS 0
57  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58  #define CYTHON_USE_ASYNC_SLOTS 1
59  #endif
60  #undef CYTHON_USE_PYLIST_INTERNALS
61  #define CYTHON_USE_PYLIST_INTERNALS 0
62  #undef CYTHON_USE_UNICODE_INTERNALS
63  #define CYTHON_USE_UNICODE_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_WRITER
65  #define CYTHON_USE_UNICODE_WRITER 0
66  #undef CYTHON_USE_PYLONG_INTERNALS
67  #define CYTHON_USE_PYLONG_INTERNALS 0
68  #undef CYTHON_AVOID_BORROWED_REFS
69  #define CYTHON_AVOID_BORROWED_REFS 1
70  #undef CYTHON_ASSUME_SAFE_MACROS
71  #define CYTHON_ASSUME_SAFE_MACROS 0
72  #undef CYTHON_UNPACK_METHODS
73  #define CYTHON_UNPACK_METHODS 0
74  #undef CYTHON_FAST_THREAD_STATE
75  #define CYTHON_FAST_THREAD_STATE 0
76  #undef CYTHON_FAST_PYCALL
77  #define CYTHON_FAST_PYCALL 0
78  #undef CYTHON_PEP489_MULTI_PHASE_INIT
79  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80  #undef CYTHON_USE_TP_FINALIZE
81  #define CYTHON_USE_TP_FINALIZE 0
82  #undef CYTHON_USE_DICT_VERSIONS
83  #define CYTHON_USE_DICT_VERSIONS 0
84  #undef CYTHON_USE_EXC_INFO_STACK
85  #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87  #define CYTHON_COMPILING_IN_PYPY 0
88  #define CYTHON_COMPILING_IN_PYSTON 1
89  #define CYTHON_COMPILING_IN_CPYTHON 0
90  #ifndef CYTHON_USE_TYPE_SLOTS
91  #define CYTHON_USE_TYPE_SLOTS 1
92  #endif
93  #undef CYTHON_USE_PYTYPE_LOOKUP
94  #define CYTHON_USE_PYTYPE_LOOKUP 0
95  #undef CYTHON_USE_ASYNC_SLOTS
96  #define CYTHON_USE_ASYNC_SLOTS 0
97  #undef CYTHON_USE_PYLIST_INTERNALS
98  #define CYTHON_USE_PYLIST_INTERNALS 0
99  #ifndef CYTHON_USE_UNICODE_INTERNALS
100  #define CYTHON_USE_UNICODE_INTERNALS 1
101  #endif
102  #undef CYTHON_USE_UNICODE_WRITER
103  #define CYTHON_USE_UNICODE_WRITER 0
104  #undef CYTHON_USE_PYLONG_INTERNALS
105  #define CYTHON_USE_PYLONG_INTERNALS 0
106  #ifndef CYTHON_AVOID_BORROWED_REFS
107  #define CYTHON_AVOID_BORROWED_REFS 0
108  #endif
109  #ifndef CYTHON_ASSUME_SAFE_MACROS
110  #define CYTHON_ASSUME_SAFE_MACROS 1
111  #endif
112  #ifndef CYTHON_UNPACK_METHODS
113  #define CYTHON_UNPACK_METHODS 1
114  #endif
115  #undef CYTHON_FAST_THREAD_STATE
116  #define CYTHON_FAST_THREAD_STATE 0
117  #undef CYTHON_FAST_PYCALL
118  #define CYTHON_FAST_PYCALL 0
119  #undef CYTHON_PEP489_MULTI_PHASE_INIT
120  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121  #undef CYTHON_USE_TP_FINALIZE
122  #define CYTHON_USE_TP_FINALIZE 0
123  #undef CYTHON_USE_DICT_VERSIONS
124  #define CYTHON_USE_DICT_VERSIONS 0
125  #undef CYTHON_USE_EXC_INFO_STACK
126  #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128  #define CYTHON_COMPILING_IN_PYPY 0
129  #define CYTHON_COMPILING_IN_PYSTON 0
130  #define CYTHON_COMPILING_IN_CPYTHON 1
131  #ifndef CYTHON_USE_TYPE_SLOTS
132  #define CYTHON_USE_TYPE_SLOTS 1
133  #endif
134  #if PY_VERSION_HEX < 0x02070000
135  #undef CYTHON_USE_PYTYPE_LOOKUP
136  #define CYTHON_USE_PYTYPE_LOOKUP 0
137  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138  #define CYTHON_USE_PYTYPE_LOOKUP 1
139  #endif
140  #if PY_MAJOR_VERSION < 3
141  #undef CYTHON_USE_ASYNC_SLOTS
142  #define CYTHON_USE_ASYNC_SLOTS 0
143  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144  #define CYTHON_USE_ASYNC_SLOTS 1
145  #endif
146  #if PY_VERSION_HEX < 0x02070000
147  #undef CYTHON_USE_PYLONG_INTERNALS
148  #define CYTHON_USE_PYLONG_INTERNALS 0
149  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150  #define CYTHON_USE_PYLONG_INTERNALS 1
151  #endif
152  #ifndef CYTHON_USE_PYLIST_INTERNALS
153  #define CYTHON_USE_PYLIST_INTERNALS 1
154  #endif
155  #ifndef CYTHON_USE_UNICODE_INTERNALS
156  #define CYTHON_USE_UNICODE_INTERNALS 1
157  #endif
158  #if PY_VERSION_HEX < 0x030300F0
159  #undef CYTHON_USE_UNICODE_WRITER
160  #define CYTHON_USE_UNICODE_WRITER 0
161  #elif !defined(CYTHON_USE_UNICODE_WRITER)
162  #define CYTHON_USE_UNICODE_WRITER 1
163  #endif
164  #ifndef CYTHON_AVOID_BORROWED_REFS
165  #define CYTHON_AVOID_BORROWED_REFS 0
166  #endif
167  #ifndef CYTHON_ASSUME_SAFE_MACROS
168  #define CYTHON_ASSUME_SAFE_MACROS 1
169  #endif
170  #ifndef CYTHON_UNPACK_METHODS
171  #define CYTHON_UNPACK_METHODS 1
172  #endif
173  #ifndef CYTHON_FAST_THREAD_STATE
174  #define CYTHON_FAST_THREAD_STATE 1
175  #endif
176  #ifndef CYTHON_FAST_PYCALL
177  #define CYTHON_FAST_PYCALL 1
178  #endif
179  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181  #endif
182  #ifndef CYTHON_USE_TP_FINALIZE
183  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184  #endif
185  #ifndef CYTHON_USE_DICT_VERSIONS
186  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187  #endif
188  #ifndef CYTHON_USE_EXC_INFO_STACK
189  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190  #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196  #include "longintrepr.h"
197  #undef SHIFT
198  #undef BASE
199  #undef MASK
200  #ifdef SIZEOF_VOID_P
201  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202  #endif
203 #endif
204 #ifndef __has_attribute
205  #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208  #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211  #if defined(__GNUC__)
212  #define CYTHON_RESTRICT __restrict__
213  #elif defined(_MSC_VER) && _MSC_VER >= 1400
214  #define CYTHON_RESTRICT __restrict
215  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216  #define CYTHON_RESTRICT restrict
217  #else
218  #define CYTHON_RESTRICT
219  #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
225 # else
226 # define CYTHON_UNUSED
227 # endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 # define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 # else
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 # endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
244 # else
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250  #ifndef _MSC_STDINT_H_
251  #if _MSC_VER < 1300
252  typedef unsigned char uint8_t;
253  typedef unsigned int uint32_t;
254  #else
255  typedef unsigned __int8 uint8_t;
256  typedef unsigned __int32 uint32_t;
257  #endif
258  #endif
259 #else
260  #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263  #if defined(__cplusplus) && __cplusplus >= 201103L
264  #if __has_cpp_attribute(fallthrough)
265  #define CYTHON_FALLTHROUGH [[fallthrough]]
266  #elif __has_cpp_attribute(clang::fallthrough)
267  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268  #elif __has_cpp_attribute(gnu::fallthrough)
269  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270  #endif
271  #endif
272  #ifndef CYTHON_FALLTHROUGH
273  #if __has_attribute(fallthrough)
274  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275  #else
276  #define CYTHON_FALLTHROUGH
277  #endif
278  #endif
279  #if defined(__clang__ ) && defined(__apple_build_version__)
280  #if __apple_build_version__ < 7000000
281  #undef CYTHON_FALLTHROUGH
282  #define CYTHON_FALLTHROUGH
283  #endif
284  #endif
285 #endif
286 
287 #ifndef __cplusplus
288  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
289 #endif
290 #ifndef CYTHON_INLINE
291  #if defined(__clang__)
292  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
293  #else
294  #define CYTHON_INLINE inline
295  #endif
296 #endif
297 template<typename T>
298 void __Pyx_call_destructor(T& x) {
299  x.~T();
300 }
301 template<typename T>
302 class __Pyx_FakeReference {
303  public:
304  __Pyx_FakeReference() : ptr(NULL) { }
305  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
306  T *operator->() { return ptr; }
307  T *operator&() { return ptr; }
308  operator T&() { return *ptr; }
309  template<typename U> bool operator ==(U other) { return *ptr == other; }
310  template<typename U> bool operator !=(U other) { return *ptr != other; }
311  private:
312  T *ptr;
313 };
314 
315 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
316  #define Py_OptimizeFlag 0
317 #endif
318 #define __PYX_BUILD_PY_SSIZE_T "n"
319 #define CYTHON_FORMAT_SSIZE_T "z"
320 #if PY_MAJOR_VERSION < 3
321  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
322  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
323  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
324  #define __Pyx_DefaultClassType PyClass_Type
325 #else
326  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
327 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
328  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
329  PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
330 #else
331  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
332  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
333 #endif
334  #define __Pyx_DefaultClassType PyType_Type
335 #endif
336 #ifndef Py_TPFLAGS_CHECKTYPES
337  #define Py_TPFLAGS_CHECKTYPES 0
338 #endif
339 #ifndef Py_TPFLAGS_HAVE_INDEX
340  #define Py_TPFLAGS_HAVE_INDEX 0
341 #endif
342 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
343  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
344 #endif
345 #ifndef Py_TPFLAGS_HAVE_FINALIZE
346  #define Py_TPFLAGS_HAVE_FINALIZE 0
347 #endif
348 #ifndef METH_STACKLESS
349  #define METH_STACKLESS 0
350 #endif
351 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
352  #ifndef METH_FASTCALL
353  #define METH_FASTCALL 0x80
354  #endif
355  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
356  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
357  Py_ssize_t nargs, PyObject *kwnames);
358 #else
359  #define __Pyx_PyCFunctionFast _PyCFunctionFast
360  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
361 #endif
362 #if CYTHON_FAST_PYCCALL
363 #define __Pyx_PyFastCFunction_Check(func)\
364  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
365 #else
366 #define __Pyx_PyFastCFunction_Check(func) 0
367 #endif
368 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
369  #define PyObject_Malloc(s) PyMem_Malloc(s)
370  #define PyObject_Free(p) PyMem_Free(p)
371  #define PyObject_Realloc(p) PyMem_Realloc(p)
372 #endif
373 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
374  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
375  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
376  #define PyMem_RawFree(p) PyMem_Free(p)
377 #endif
378 #if CYTHON_COMPILING_IN_PYSTON
379  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
380  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
381 #else
382  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
383  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
384 #endif
385 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
386  #define __Pyx_PyThreadState_Current PyThreadState_GET()
387 #elif PY_VERSION_HEX >= 0x03060000
388  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
389 #elif PY_VERSION_HEX >= 0x03000000
390  #define __Pyx_PyThreadState_Current PyThreadState_GET()
391 #else
392  #define __Pyx_PyThreadState_Current _PyThreadState_Current
393 #endif
394 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
395 #include "pythread.h"
396 #define Py_tss_NEEDS_INIT 0
397 typedef int Py_tss_t;
398 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
399  *key = PyThread_create_key();
400  return 0;
401 }
402 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
403  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
404  *key = Py_tss_NEEDS_INIT;
405  return key;
406 }
407 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
408  PyObject_Free(key);
409 }
410 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
411  return *key != Py_tss_NEEDS_INIT;
412 }
413 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
414  PyThread_delete_key(*key);
415  *key = Py_tss_NEEDS_INIT;
416 }
417 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
418  return PyThread_set_key_value(*key, value);
419 }
420 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
421  return PyThread_get_key_value(*key);
422 }
423 #endif
424 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
425 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
426 #else
427 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
428 #endif
429 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
430  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
431  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
432 #else
433  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
434  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
435 #endif
436 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
437 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
438 #else
439 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
440 #endif
441 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
442  #define CYTHON_PEP393_ENABLED 1
443  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
444  0 : _PyUnicode_Ready((PyObject *)(op)))
445  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
446  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
447  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
448  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
449  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
450  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
451  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
452  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
453 #else
454  #define CYTHON_PEP393_ENABLED 0
455  #define PyUnicode_1BYTE_KIND 1
456  #define PyUnicode_2BYTE_KIND 2
457  #define PyUnicode_4BYTE_KIND 4
458  #define __Pyx_PyUnicode_READY(op) (0)
459  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
460  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
461  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
462  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
463  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
464  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
465  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
466  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
467 #endif
468 #if CYTHON_COMPILING_IN_PYPY
469  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
470  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
471 #else
472  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
473  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
474  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
475 #endif
476 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
477  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
478 #endif
479 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
480  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
481 #endif
482 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
483  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
484 #endif
485 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
486 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
487 #if PY_MAJOR_VERSION >= 3
488  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
489 #else
490  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
491 #endif
492 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
493  #define PyObject_ASCII(o) PyObject_Repr(o)
494 #endif
495 #if PY_MAJOR_VERSION >= 3
496  #define PyBaseString_Type PyUnicode_Type
497  #define PyStringObject PyUnicodeObject
498  #define PyString_Type PyUnicode_Type
499  #define PyString_Check PyUnicode_Check
500  #define PyString_CheckExact PyUnicode_CheckExact
501 #ifndef PyObject_Unicode
502  #define PyObject_Unicode PyObject_Str
503 #endif
504 #endif
505 #if PY_MAJOR_VERSION >= 3
506  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
507  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
508 #else
509  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
510  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
511 #endif
512 #ifndef PySet_CheckExact
513  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
514 #endif
515 #if CYTHON_ASSUME_SAFE_MACROS
516  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
517 #else
518  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
519 #endif
520 #if PY_MAJOR_VERSION >= 3
521  #define PyIntObject PyLongObject
522  #define PyInt_Type PyLong_Type
523  #define PyInt_Check(op) PyLong_Check(op)
524  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
525  #define PyInt_FromString PyLong_FromString
526  #define PyInt_FromUnicode PyLong_FromUnicode
527  #define PyInt_FromLong PyLong_FromLong
528  #define PyInt_FromSize_t PyLong_FromSize_t
529  #define PyInt_FromSsize_t PyLong_FromSsize_t
530  #define PyInt_AsLong PyLong_AsLong
531  #define PyInt_AS_LONG PyLong_AS_LONG
532  #define PyInt_AsSsize_t PyLong_AsSsize_t
533  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
534  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
535  #define PyNumber_Int PyNumber_Long
536 #endif
537 #if PY_MAJOR_VERSION >= 3
538  #define PyBoolObject PyLongObject
539 #endif
540 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
541  #ifndef PyUnicode_InternFromString
542  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
543  #endif
544 #endif
545 #if PY_VERSION_HEX < 0x030200A4
546  typedef long Py_hash_t;
547  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
548  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
549 #else
550  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
551  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
552 #endif
553 #if PY_MAJOR_VERSION >= 3
554  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
555 #else
556  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
557 #endif
558 #if CYTHON_USE_ASYNC_SLOTS
559  #if PY_VERSION_HEX >= 0x030500B1
560  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
561  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
562  #else
563  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
564  #endif
565 #else
566  #define __Pyx_PyType_AsAsync(obj) NULL
567 #endif
568 #ifndef __Pyx_PyAsyncMethodsStruct
569  typedef struct {
570  unaryfunc am_await;
571  unaryfunc am_aiter;
572  unaryfunc am_anext;
573  } __Pyx_PyAsyncMethodsStruct;
574 #endif
575 
576 #if defined(WIN32) || defined(MS_WINDOWS)
577  #define _USE_MATH_DEFINES
578 #endif
579 #include <math.h>
580 #ifdef NAN
581 #define __PYX_NAN() ((float) NAN)
582 #else
583 static CYTHON_INLINE float __PYX_NAN() {
584  float value;
585  memset(&value, 0xFF, sizeof(value));
586  return value;
587 }
588 #endif
589 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
590 #define __Pyx_truncl trunc
591 #else
592 #define __Pyx_truncl truncl
593 #endif
594 
595 
596 #define __PYX_ERR(f_index, lineno, Ln_error) \
597 { \
598  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
599 }
600 
601 #ifndef __PYX_EXTERN_C
602  #ifdef __cplusplus
603  #define __PYX_EXTERN_C extern "C"
604  #else
605  #define __PYX_EXTERN_C extern
606  #endif
607 #endif
608 
609 #define __PYX_HAVE__cpartitioning
610 #define __PYX_HAVE_API__cpartitioning
611 /* Early includes */
612 #include <string.h>
613 #include <stdio.h>
614 #include "numpy/arrayobject.h"
615 #include "numpy/ufuncobject.h"
616 #include "mpi.h"
617 #include "mesh.h"
618 #include "partitioning.h"
619 #include "pythread.h"
620 #include <stdlib.h>
621 #include "pystate.h"
622 #ifdef _OPENMP
623 #include <omp.h>
624 #endif /* _OPENMP */
625 
626 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
627 #define CYTHON_WITHOUT_ASSERTIONS
628 #endif
629 
630 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
631  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
632 
633 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
634 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
635 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
636 #define __PYX_DEFAULT_STRING_ENCODING ""
637 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
638 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
639 #define __Pyx_uchar_cast(c) ((unsigned char)c)
640 #define __Pyx_long_cast(x) ((long)x)
641 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
642  (sizeof(type) < sizeof(Py_ssize_t)) ||\
643  (sizeof(type) > sizeof(Py_ssize_t) &&\
644  likely(v < (type)PY_SSIZE_T_MAX ||\
645  v == (type)PY_SSIZE_T_MAX) &&\
646  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
647  v == (type)PY_SSIZE_T_MIN))) ||\
648  (sizeof(type) == sizeof(Py_ssize_t) &&\
649  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
650  v == (type)PY_SSIZE_T_MAX))) )
651 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
652  return (size_t) i < (size_t) limit;
653 }
654 #if defined (__cplusplus) && __cplusplus >= 201103L
655  #include <cstdlib>
656  #define __Pyx_sst_abs(value) std::abs(value)
657 #elif SIZEOF_INT >= SIZEOF_SIZE_T
658  #define __Pyx_sst_abs(value) abs(value)
659 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
660  #define __Pyx_sst_abs(value) labs(value)
661 #elif defined (_MSC_VER)
662  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
663 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
664  #define __Pyx_sst_abs(value) llabs(value)
665 #elif defined (__GNUC__)
666  #define __Pyx_sst_abs(value) __builtin_llabs(value)
667 #else
668  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
669 #endif
670 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
671 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
672 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
673 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
674 #define __Pyx_PyBytes_FromString PyBytes_FromString
675 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
676 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
677 #if PY_MAJOR_VERSION < 3
678  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
679  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
680 #else
681  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
682  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
683 #endif
684 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
685 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
686 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
687 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
688 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
689 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
690 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
691 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
692 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
693 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
694 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
695 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
696 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
697 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
698 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
699 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
700 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
701  const Py_UNICODE *u_end = u;
702  while (*u_end++) ;
703  return (size_t)(u_end - u - 1);
704 }
705 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
706 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
707 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
708 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
709 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
710 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
711 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
712 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
713 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
714 #define __Pyx_PySequence_Tuple(obj)\
715  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
716 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
717 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
718 #if CYTHON_ASSUME_SAFE_MACROS
719 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
720 #else
721 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
722 #endif
723 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
724 #if PY_MAJOR_VERSION >= 3
725 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
726 #else
727 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
728 #endif
729 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
730 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
731 static int __Pyx_sys_getdefaultencoding_not_ascii;
732 static int __Pyx_init_sys_getdefaultencoding_params(void) {
733  PyObject* sys;
734  PyObject* default_encoding = NULL;
735  PyObject* ascii_chars_u = NULL;
736  PyObject* ascii_chars_b = NULL;
737  const char* default_encoding_c;
738  sys = PyImport_ImportModule("sys");
739  if (!sys) goto bad;
740  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
741  Py_DECREF(sys);
742  if (!default_encoding) goto bad;
743  default_encoding_c = PyBytes_AsString(default_encoding);
744  if (!default_encoding_c) goto bad;
745  if (strcmp(default_encoding_c, "ascii") == 0) {
746  __Pyx_sys_getdefaultencoding_not_ascii = 0;
747  } else {
748  char ascii_chars[128];
749  int c;
750  for (c = 0; c < 128; c++) {
751  ascii_chars[c] = c;
752  }
753  __Pyx_sys_getdefaultencoding_not_ascii = 1;
754  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
755  if (!ascii_chars_u) goto bad;
756  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
757  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
758  PyErr_Format(
759  PyExc_ValueError,
760  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
761  default_encoding_c);
762  goto bad;
763  }
764  Py_DECREF(ascii_chars_u);
765  Py_DECREF(ascii_chars_b);
766  }
767  Py_DECREF(default_encoding);
768  return 0;
769 bad:
770  Py_XDECREF(default_encoding);
771  Py_XDECREF(ascii_chars_u);
772  Py_XDECREF(ascii_chars_b);
773  return -1;
774 }
775 #endif
776 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
777 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
778 #else
779 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
780 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
781 static char* __PYX_DEFAULT_STRING_ENCODING;
782 static int __Pyx_init_sys_getdefaultencoding_params(void) {
783  PyObject* sys;
784  PyObject* default_encoding = NULL;
785  char* default_encoding_c;
786  sys = PyImport_ImportModule("sys");
787  if (!sys) goto bad;
788  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
789  Py_DECREF(sys);
790  if (!default_encoding) goto bad;
791  default_encoding_c = PyBytes_AsString(default_encoding);
792  if (!default_encoding_c) goto bad;
793  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
794  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
795  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
796  Py_DECREF(default_encoding);
797  return 0;
798 bad:
799  Py_XDECREF(default_encoding);
800  return -1;
801 }
802 #endif
803 #endif
804 
805 
806 /* Test for GCC > 2.95 */
807 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
808  #define likely(x) __builtin_expect(!!(x), 1)
809  #define unlikely(x) __builtin_expect(!!(x), 0)
810 #else /* !__GNUC__ or GCC < 2.95 */
811  #define likely(x) (x)
812  #define unlikely(x) (x)
813 #endif /* __GNUC__ */
814 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
815 
816 static PyObject *__pyx_m = NULL;
817 static PyObject *__pyx_d;
818 static PyObject *__pyx_b;
819 static PyObject *__pyx_cython_runtime = NULL;
820 static PyObject *__pyx_empty_tuple;
821 static PyObject *__pyx_empty_bytes;
822 static PyObject *__pyx_empty_unicode;
823 static int __pyx_lineno;
824 static int __pyx_clineno = 0;
825 static const char * __pyx_cfilenm= __FILE__;
826 static const char *__pyx_filename;
827 
828 /* Header.proto */
829 #if !defined(CYTHON_CCOMPLEX)
830  #if defined(__cplusplus)
831  #define CYTHON_CCOMPLEX 1
832  #elif defined(_Complex_I)
833  #define CYTHON_CCOMPLEX 1
834  #else
835  #define CYTHON_CCOMPLEX 0
836  #endif
837 #endif
838 #if CYTHON_CCOMPLEX
839  #ifdef __cplusplus
840  #include <complex>
841  #else
842  #include <complex.h>
843  #endif
844 #endif
845 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
846  #undef _Complex_I
847  #define _Complex_I 1.0fj
848 #endif
849 
850 
851 static const char *__pyx_f[] = {
852  "proteus/cpartitioning.pyx",
853  "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd",
854  "stringsource",
855  "linux/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd",
856  "linux/lib/python3.7/site-packages/mpi4py/MPI.pxd",
857  "proteus/cmeshTools.pxd",
858 };
859 /* ForceInitThreads.proto */
860 #ifndef __PYX_FORCE_INIT_THREADS
861  #define __PYX_FORCE_INIT_THREADS 0
862 #endif
863 
864 /* NoFastGil.proto */
865 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
866 #define __Pyx_PyGILState_Release PyGILState_Release
867 #define __Pyx_FastGIL_Remember()
868 #define __Pyx_FastGIL_Forget()
869 #define __Pyx_FastGilFuncInit()
870 
871 /* BufferFormatStructs.proto */
872 #define IS_UNSIGNED(type) (((type) -1) > 0)
873 struct __Pyx_StructField_;
874 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
875 typedef struct {
876  const char* name;
877  struct __Pyx_StructField_* fields;
878  size_t size;
879  size_t arraysize[8];
880  int ndim;
881  char typegroup;
882  char is_unsigned;
883  int flags;
884 } __Pyx_TypeInfo;
885 typedef struct __Pyx_StructField_ {
886  __Pyx_TypeInfo* type;
887  const char* name;
888  size_t offset;
889 } __Pyx_StructField;
890 typedef struct {
891  __Pyx_StructField* field;
892  size_t parent_offset;
893 } __Pyx_BufFmt_StackElem;
894 typedef struct {
895  __Pyx_StructField root;
896  __Pyx_BufFmt_StackElem* head;
897  size_t fmt_offset;
898  size_t new_count, enc_count;
899  size_t struct_alignment;
900  int is_complex;
901  char enc_type;
902  char new_packmode;
903  char enc_packmode;
904  char is_valid_array;
905 } __Pyx_BufFmt_Context;
906 
907 /* Atomics.proto */
908 #include <pythread.h>
909 #ifndef CYTHON_ATOMICS
910  #define CYTHON_ATOMICS 1
911 #endif
912 #define __pyx_atomic_int_type int
913 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
914  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
915  !defined(__i386__)
916  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
917  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
918  #ifdef __PYX_DEBUG_ATOMICS
919  #warning "Using GNU atomics"
920  #endif
921 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
922  #include <Windows.h>
923  #undef __pyx_atomic_int_type
924  #define __pyx_atomic_int_type LONG
925  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
926  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
927  #ifdef __PYX_DEBUG_ATOMICS
928  #pragma message ("Using MSVC atomics")
929  #endif
930 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
931  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
932  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
933  #ifdef __PYX_DEBUG_ATOMICS
934  #warning "Using Intel atomics"
935  #endif
936 #else
937  #undef CYTHON_ATOMICS
938  #define CYTHON_ATOMICS 0
939  #ifdef __PYX_DEBUG_ATOMICS
940  #warning "Not using atomics"
941  #endif
942 #endif
943 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
944 #if CYTHON_ATOMICS
945  #define __pyx_add_acquisition_count(memview)\
946  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
947  #define __pyx_sub_acquisition_count(memview)\
948  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
949 #else
950  #define __pyx_add_acquisition_count(memview)\
951  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
952  #define __pyx_sub_acquisition_count(memview)\
953  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
954 #endif
955 
956 /* MemviewSliceStruct.proto */
957 struct __pyx_memoryview_obj;
958 typedef struct {
959  struct __pyx_memoryview_obj *memview;
960  char *data;
961  Py_ssize_t shape[8];
962  Py_ssize_t strides[8];
963  Py_ssize_t suboffsets[8];
964 } __Pyx_memviewslice;
965 #define __Pyx_MemoryView_Len(m) (m.shape[0])
966 
967 
968 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
969  * # in Cython to enable them only on the right systems.
970  *
971  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
972  * ctypedef npy_int16 int16_t
973  * ctypedef npy_int32 int32_t
974  */
975 typedef npy_int8 __pyx_t_5numpy_int8_t;
976 
977 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
978  *
979  * ctypedef npy_int8 int8_t
980  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
981  * ctypedef npy_int32 int32_t
982  * ctypedef npy_int64 int64_t
983  */
984 typedef npy_int16 __pyx_t_5numpy_int16_t;
985 
986 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
987  * ctypedef npy_int8 int8_t
988  * ctypedef npy_int16 int16_t
989  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
990  * ctypedef npy_int64 int64_t
991  * #ctypedef npy_int96 int96_t
992  */
993 typedef npy_int32 __pyx_t_5numpy_int32_t;
994 
995 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
996  * ctypedef npy_int16 int16_t
997  * ctypedef npy_int32 int32_t
998  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
999  * #ctypedef npy_int96 int96_t
1000  * #ctypedef npy_int128 int128_t
1001  */
1002 typedef npy_int64 __pyx_t_5numpy_int64_t;
1003 
1004 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
1005  * #ctypedef npy_int128 int128_t
1006  *
1007  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1008  * ctypedef npy_uint16 uint16_t
1009  * ctypedef npy_uint32 uint32_t
1010  */
1011 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1012 
1013 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
1014  *
1015  * ctypedef npy_uint8 uint8_t
1016  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1017  * ctypedef npy_uint32 uint32_t
1018  * ctypedef npy_uint64 uint64_t
1019  */
1020 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1021 
1022 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
1023  * ctypedef npy_uint8 uint8_t
1024  * ctypedef npy_uint16 uint16_t
1025  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1026  * ctypedef npy_uint64 uint64_t
1027  * #ctypedef npy_uint96 uint96_t
1028  */
1029 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1030 
1031 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":786
1032  * ctypedef npy_uint16 uint16_t
1033  * ctypedef npy_uint32 uint32_t
1034  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1035  * #ctypedef npy_uint96 uint96_t
1036  * #ctypedef npy_uint128 uint128_t
1037  */
1038 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1039 
1040 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
1041  * #ctypedef npy_uint128 uint128_t
1042  *
1043  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1044  * ctypedef npy_float64 float64_t
1045  * #ctypedef npy_float80 float80_t
1046  */
1047 typedef npy_float32 __pyx_t_5numpy_float32_t;
1048 
1049 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
1050  *
1051  * ctypedef npy_float32 float32_t
1052  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1053  * #ctypedef npy_float80 float80_t
1054  * #ctypedef npy_float128 float128_t
1055  */
1056 typedef npy_float64 __pyx_t_5numpy_float64_t;
1057 
1058 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":800
1059  * # The int types are mapped a bit surprising --
1060  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1061  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1062  * ctypedef npy_longlong long_t
1063  * ctypedef npy_longlong longlong_t
1064  */
1065 typedef npy_long __pyx_t_5numpy_int_t;
1066 
1067 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
1068  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1069  * ctypedef npy_long int_t
1070  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1071  * ctypedef npy_longlong longlong_t
1072  *
1073  */
1074 typedef npy_longlong __pyx_t_5numpy_long_t;
1075 
1076 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
1077  * ctypedef npy_long int_t
1078  * ctypedef npy_longlong long_t
1079  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1080  *
1081  * ctypedef npy_ulong uint_t
1082  */
1083 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1084 
1085 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":804
1086  * ctypedef npy_longlong longlong_t
1087  *
1088  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1089  * ctypedef npy_ulonglong ulong_t
1090  * ctypedef npy_ulonglong ulonglong_t
1091  */
1092 typedef npy_ulong __pyx_t_5numpy_uint_t;
1093 
1094 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
1095  *
1096  * ctypedef npy_ulong uint_t
1097  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1098  * ctypedef npy_ulonglong ulonglong_t
1099  *
1100  */
1101 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1102 
1103 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
1104  * ctypedef npy_ulong uint_t
1105  * ctypedef npy_ulonglong ulong_t
1106  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1107  *
1108  * ctypedef npy_intp intp_t
1109  */
1110 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1111 
1112 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":808
1113  * ctypedef npy_ulonglong ulonglong_t
1114  *
1115  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1116  * ctypedef npy_uintp uintp_t
1117  *
1118  */
1119 typedef npy_intp __pyx_t_5numpy_intp_t;
1120 
1121 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
1122  *
1123  * ctypedef npy_intp intp_t
1124  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1125  *
1126  * ctypedef npy_double float_t
1127  */
1128 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1129 
1130 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":811
1131  * ctypedef npy_uintp uintp_t
1132  *
1133  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1134  * ctypedef npy_double double_t
1135  * ctypedef npy_longdouble longdouble_t
1136  */
1137 typedef npy_double __pyx_t_5numpy_float_t;
1138 
1139 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
1140  *
1141  * ctypedef npy_double float_t
1142  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1143  * ctypedef npy_longdouble longdouble_t
1144  *
1145  */
1146 typedef npy_double __pyx_t_5numpy_double_t;
1147 
1148 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
1149  * ctypedef npy_double float_t
1150  * ctypedef npy_double double_t
1151  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1152  *
1153  * ctypedef npy_cfloat cfloat_t
1154  */
1155 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1156 /* Declarations.proto */
1157 #if CYTHON_CCOMPLEX
1158  #ifdef __cplusplus
1159  typedef ::std::complex< float > __pyx_t_float_complex;
1160  #else
1161  typedef float _Complex __pyx_t_float_complex;
1162  #endif
1163 #else
1164  typedef struct { float real, imag; } __pyx_t_float_complex;
1165 #endif
1166 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1167 
1168 /* Declarations.proto */
1169 #if CYTHON_CCOMPLEX
1170  #ifdef __cplusplus
1171  typedef ::std::complex< double > __pyx_t_double_complex;
1172  #else
1173  typedef double _Complex __pyx_t_double_complex;
1174  #endif
1175 #else
1176  typedef struct { double real, imag; } __pyx_t_double_complex;
1177 #endif
1178 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1179 
1180 
1181 /*--- Type declarations ---*/
1182 struct PyMPIStatusObject;
1183 struct PyMPIDatatypeObject;
1184 struct PyMPIRequestObject;
1185 struct PyMPIPrequestObject;
1186 struct PyMPIGrequestObject;
1187 struct PyMPIMessageObject;
1188 struct PyMPIOpObject;
1189 struct PyMPIGroupObject;
1190 struct PyMPIInfoObject;
1191 struct PyMPIErrhandlerObject;
1192 struct PyMPICommObject;
1193 struct PyMPIIntracommObject;
1194 struct PyMPITopocommObject;
1195 struct PyMPICartcommObject;
1196 struct PyMPIGraphcommObject;
1197 struct PyMPIDistgraphcommObject;
1198 struct PyMPIIntercommObject;
1199 struct PyMPIWinObject;
1200 struct PyMPIFileObject;
1201 struct __pyx_obj_7proteus_10cmeshTools_CMesh;
1202 struct __pyx_array_obj;
1203 struct __pyx_MemviewEnum_obj;
1204 struct __pyx_memoryview_obj;
1205 struct __pyx_memoryviewslice_obj;
1206 
1207 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
1208  * ctypedef npy_longdouble longdouble_t
1209  *
1210  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1211  * ctypedef npy_cdouble cdouble_t
1212  * ctypedef npy_clongdouble clongdouble_t
1213  */
1214 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1215 
1216 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
1217  *
1218  * ctypedef npy_cfloat cfloat_t
1219  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1220  * ctypedef npy_clongdouble clongdouble_t
1221  *
1222  */
1223 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1224 
1225 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":817
1226  * ctypedef npy_cfloat cfloat_t
1227  * ctypedef npy_cdouble cdouble_t
1228  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1229  *
1230  * ctypedef npy_cdouble complex_t
1231  */
1232 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1233 
1234 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":819
1235  * ctypedef npy_clongdouble clongdouble_t
1236  *
1237  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1238  *
1239  * cdef inline object PyArray_MultiIterNew1(a):
1240  */
1241 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1242 
1243 /* "mpi4py/MPI.pxd":28
1244  * ctypedef MPI_Count Count "MPI_Count"
1245  *
1246  * ctypedef public api class Status [ # <<<<<<<<<<<<<<
1247  * type PyMPIStatus_Type,
1248  * object PyMPIStatusObject,
1249  */
1250 struct PyMPIStatusObject {
1251  PyObject_HEAD
1252  MPI_Status ob_mpi;
1253  unsigned int flags;
1254 };
1255 typedef struct PyMPIStatusObject PyMPIStatusObject;
1256 
1257 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIStatus_Type;
1258 
1259 /* "mpi4py/MPI.pxd":35
1260  * cdef unsigned flags
1261  *
1262  * ctypedef public api class Datatype [ # <<<<<<<<<<<<<<
1263  * type PyMPIDatatype_Type,
1264  * object PyMPIDatatypeObject,
1265  */
1266 struct PyMPIDatatypeObject {
1267  PyObject_HEAD
1268  MPI_Datatype ob_mpi;
1269  unsigned int flags;
1270 };
1271 typedef struct PyMPIDatatypeObject PyMPIDatatypeObject;
1272 
1273 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDatatype_Type;
1274 
1275 /* "mpi4py/MPI.pxd":42
1276  * cdef unsigned flags
1277  *
1278  * ctypedef public api class Request [ # <<<<<<<<<<<<<<
1279  * type PyMPIRequest_Type,
1280  * object PyMPIRequestObject,
1281  */
1282 struct PyMPIRequestObject {
1283  PyObject_HEAD
1284  MPI_Request ob_mpi;
1285  unsigned int flags;
1286  PyObject *ob_buf;
1287 };
1288 typedef struct PyMPIRequestObject PyMPIRequestObject;
1289 
1290 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIRequest_Type;
1291 
1292 /* "mpi4py/MPI.pxd":50
1293  * cdef object ob_buf
1294  *
1295  * ctypedef public api class Prequest(Request) [ # <<<<<<<<<<<<<<
1296  * type PyMPIPrequest_Type,
1297  * object PyMPIPrequestObject,
1298  */
1299 struct PyMPIPrequestObject {
1300  struct PyMPIRequestObject __pyx_base;
1301 };
1302 typedef struct PyMPIPrequestObject PyMPIPrequestObject;
1303 
1304 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIPrequest_Type;
1305 
1306 /* "mpi4py/MPI.pxd":56
1307  * pass
1308  *
1309  * ctypedef public api class Grequest(Request) [ # <<<<<<<<<<<<<<
1310  * type PyMPIGrequest_Type,
1311  * object PyMPIGrequestObject,
1312  */
1313 struct PyMPIGrequestObject {
1314  struct PyMPIRequestObject __pyx_base;
1315  MPI_Request ob_grequest;
1316 };
1317 typedef struct PyMPIGrequestObject PyMPIGrequestObject;
1318 
1319 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGrequest_Type;
1320 
1321 /* "mpi4py/MPI.pxd":62
1322  * cdef MPI_Request ob_grequest
1323  *
1324  * ctypedef public api class Message [ # <<<<<<<<<<<<<<
1325  * type PyMPIMessage_Type,
1326  * object PyMPIMessageObject,
1327  */
1328 struct PyMPIMessageObject {
1329  PyObject_HEAD
1330  MPI_Message ob_mpi;
1331  unsigned int flags;
1332  PyObject *ob_buf;
1333 };
1334 typedef struct PyMPIMessageObject PyMPIMessageObject;
1335 
1336 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIMessage_Type;
1337 
1338 /* "mpi4py/MPI.pxd":70
1339  * cdef object ob_buf
1340  *
1341  * ctypedef public api class Op [ # <<<<<<<<<<<<<<
1342  * type PyMPIOp_Type,
1343  * object PyMPIOpObject,
1344  */
1345 struct PyMPIOpObject {
1346  PyObject_HEAD
1347  MPI_Op ob_mpi;
1348  unsigned int flags;
1349  PyObject *(*ob_func)(PyObject *, PyObject *);
1350  int ob_usrid;
1351 };
1352 typedef struct PyMPIOpObject PyMPIOpObject;
1353 
1354 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIOp_Type;
1355 
1356 /* "mpi4py/MPI.pxd":79
1357  * cdef int ob_usrid
1358  *
1359  * ctypedef public api class Group [ # <<<<<<<<<<<<<<
1360  * type PyMPIGroup_Type,
1361  * object PyMPIGroupObject,
1362  */
1363 struct PyMPIGroupObject {
1364  PyObject_HEAD
1365  MPI_Group ob_mpi;
1366  unsigned int flags;
1367 };
1368 typedef struct PyMPIGroupObject PyMPIGroupObject;
1369 
1370 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGroup_Type;
1371 
1372 /* "mpi4py/MPI.pxd":86
1373  * cdef unsigned flags
1374  *
1375  * ctypedef public api class Info [ # <<<<<<<<<<<<<<
1376  * type PyMPIInfo_Type,
1377  * object PyMPIInfoObject,
1378  */
1379 struct PyMPIInfoObject {
1380  PyObject_HEAD
1381  MPI_Info ob_mpi;
1382  unsigned int flags;
1383 };
1384 typedef struct PyMPIInfoObject PyMPIInfoObject;
1385 
1386 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIInfo_Type;
1387 
1388 /* "mpi4py/MPI.pxd":93
1389  * cdef unsigned flags
1390  *
1391  * ctypedef public api class Errhandler [ # <<<<<<<<<<<<<<
1392  * type PyMPIErrhandler_Type,
1393  * object PyMPIErrhandlerObject,
1394  */
1395 struct PyMPIErrhandlerObject {
1396  PyObject_HEAD
1397  MPI_Errhandler ob_mpi;
1398  unsigned int flags;
1399 };
1400 typedef struct PyMPIErrhandlerObject PyMPIErrhandlerObject;
1401 
1402 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIErrhandler_Type;
1403 
1404 /* "mpi4py/MPI.pxd":100
1405  * cdef unsigned flags
1406  *
1407  * ctypedef public api class Comm [ # <<<<<<<<<<<<<<
1408  * type PyMPIComm_Type,
1409  * object PyMPICommObject,
1410  */
1411 struct PyMPICommObject {
1412  PyObject_HEAD
1413  MPI_Comm ob_mpi;
1414  unsigned int flags;
1415 };
1416 typedef struct PyMPICommObject PyMPICommObject;
1417 
1418 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIComm_Type;
1419 
1420 /* "mpi4py/MPI.pxd":107
1421  * cdef unsigned flags
1422  *
1423  * ctypedef public api class Intracomm(Comm) [ # <<<<<<<<<<<<<<
1424  * type PyMPIIntracomm_Type,
1425  * object PyMPIIntracommObject,
1426  */
1427 struct PyMPIIntracommObject {
1428  struct PyMPICommObject __pyx_base;
1429 };
1430 typedef struct PyMPIIntracommObject PyMPIIntracommObject;
1431 
1432 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntracomm_Type;
1433 
1434 /* "mpi4py/MPI.pxd":113
1435  * pass
1436  *
1437  * ctypedef public api class Topocomm(Intracomm) [ # <<<<<<<<<<<<<<
1438  * type PyMPITopocomm_Type,
1439  * object PyMPITopocommObject,
1440  */
1441 struct PyMPITopocommObject {
1442  struct PyMPIIntracommObject __pyx_base;
1443 };
1444 typedef struct PyMPITopocommObject PyMPITopocommObject;
1445 
1446 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPITopocomm_Type;
1447 
1448 /* "mpi4py/MPI.pxd":119
1449  * pass
1450  *
1451  * ctypedef public api class Cartcomm(Topocomm) [ # <<<<<<<<<<<<<<
1452  * type PyMPICartcomm_Type,
1453  * object PyMPICartcommObject,
1454  */
1455 struct PyMPICartcommObject {
1456  struct PyMPITopocommObject __pyx_base;
1457 };
1458 typedef struct PyMPICartcommObject PyMPICartcommObject;
1459 
1460 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPICartcomm_Type;
1461 
1462 /* "mpi4py/MPI.pxd":125
1463  * pass
1464  *
1465  * ctypedef public api class Graphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1466  * type PyMPIGraphcomm_Type,
1467  * object PyMPIGraphcommObject,
1468  */
1469 struct PyMPIGraphcommObject {
1470  struct PyMPITopocommObject __pyx_base;
1471 };
1472 typedef struct PyMPIGraphcommObject PyMPIGraphcommObject;
1473 
1474 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGraphcomm_Type;
1475 
1476 /* "mpi4py/MPI.pxd":131
1477  * pass
1478  *
1479  * ctypedef public api class Distgraphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1480  * type PyMPIDistgraphcomm_Type,
1481  * object PyMPIDistgraphcommObject,
1482  */
1483 struct PyMPIDistgraphcommObject {
1484  struct PyMPITopocommObject __pyx_base;
1485 };
1486 typedef struct PyMPIDistgraphcommObject PyMPIDistgraphcommObject;
1487 
1488 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDistgraphcomm_Type;
1489 
1490 /* "mpi4py/MPI.pxd":137
1491  * pass
1492  *
1493  * ctypedef public api class Intercomm(Comm) [ # <<<<<<<<<<<<<<
1494  * type PyMPIIntercomm_Type,
1495  * object PyMPIIntercommObject,
1496  */
1497 struct PyMPIIntercommObject {
1498  struct PyMPICommObject __pyx_base;
1499 };
1500 typedef struct PyMPIIntercommObject PyMPIIntercommObject;
1501 
1502 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntercomm_Type;
1503 
1504 /* "mpi4py/MPI.pxd":143
1505  * pass
1506  *
1507  * ctypedef public api class Win [ # <<<<<<<<<<<<<<
1508  * type PyMPIWin_Type,
1509  * object PyMPIWinObject,
1510  */
1511 struct PyMPIWinObject {
1512  PyObject_HEAD
1513  MPI_Win ob_mpi;
1514  unsigned int flags;
1515  PyObject *ob_mem;
1516 };
1517 typedef struct PyMPIWinObject PyMPIWinObject;
1518 
1519 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIWin_Type;
1520 
1521 /* "mpi4py/MPI.pxd":151
1522  * cdef object ob_mem
1523  *
1524  * ctypedef public api class File [ # <<<<<<<<<<<<<<
1525  * type PyMPIFile_Type,
1526  * object PyMPIFileObject,
1527  */
1528 struct PyMPIFileObject {
1529  PyObject_HEAD
1530  MPI_File ob_mpi;
1531  unsigned int flags;
1532 };
1533 typedef struct PyMPIFileObject PyMPIFileObject;
1534 
1535 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIFile_Type;
1536 
1537 /* "cmeshTools.pxd":5
1538  * cimport mesh as cppm
1539  *
1540  * cdef class CMesh: # <<<<<<<<<<<<<<
1541  * cdef cppm.Mesh mesh
1542  * cdef public:
1543  */
1544 struct __pyx_obj_7proteus_10cmeshTools_CMesh {
1545  PyObject_HEAD
1546  struct Mesh mesh;
1547  int nElements_global;
1548  int nNodes_global;
1549  int nNodes_element;
1555  int max_nElements_node;
1556  int nEdges_global;
1558  PyArrayObject *elementNodesArray;
1559  PyArrayObject *nodeElementsArray;
1560  PyArrayObject *nodeElementOffsets;
1561  PyArrayObject *elementNeighborsArray;
1562  PyArrayObject *elementBoundariesArray;
1563  PyArrayObject *elementBoundaryNodesArray;
1564  PyArrayObject *elementBoundaryElementsArray;
1566  PyArrayObject *interiorElementBoundariesArray;
1567  PyArrayObject *exteriorElementBoundariesArray;
1568  PyArrayObject *edgeNodesArray;
1569  PyArrayObject *nodeStarArray;
1570  PyArrayObject *nodeStarOffsets;
1571  PyArrayObject *elementMaterialTypes;
1572  PyArrayObject *elementBoundaryMaterialTypes;
1573  PyArrayObject *nodeMaterialTypes;
1574  PyArrayObject *nodeArray;
1575  int nx;
1576  int ny;
1577  int nz;
1578  int px;
1579  int py;
1580  int pz;
1581  PyArrayObject *elementIJK;
1582  PyArrayObject *weights;
1583  PyArrayObject *U_KNOT;
1584  PyArrayObject *V_KNOT;
1585  PyArrayObject *W_KNOT;
1586  PyArrayObject *elementDiametersArray;
1587  PyArrayObject *elementInnerDiametersArray;
1588  PyArrayObject *elementBoundaryDiametersArray;
1589  PyArrayObject *elementBarycentersArray;
1590  PyArrayObject *elementBoundaryBarycentersArray;
1591  PyArrayObject *nodeDiametersArray;
1592  PyArrayObject *nodeSupportArray;
1593  double h;
1594  double hMin;
1595  double sigmaMax;
1596  double volume;
1597 };
1598 
1599 
1600 /* "View.MemoryView":105
1601  *
1602  * @cname("__pyx_array")
1603  * cdef class array: # <<<<<<<<<<<<<<
1604  *
1605  * cdef:
1606  */
1607 struct __pyx_array_obj {
1608  PyObject_HEAD
1609  struct __pyx_vtabstruct_array *__pyx_vtab;
1610  char *data;
1611  Py_ssize_t len;
1612  char *format;
1613  int ndim;
1614  Py_ssize_t *_shape;
1615  Py_ssize_t *_strides;
1616  Py_ssize_t itemsize;
1617  PyObject *mode;
1618  PyObject *_format;
1619  void (*callback_free_data)(void *);
1620  int free_data;
1621  int dtype_is_object;
1622 };
1623 
1624 
1625 /* "View.MemoryView":279
1626  *
1627  * @cname('__pyx_MemviewEnum')
1628  * cdef class Enum(object): # <<<<<<<<<<<<<<
1629  * cdef object name
1630  * def __init__(self, name):
1631  */
1632 struct __pyx_MemviewEnum_obj {
1633  PyObject_HEAD
1634  PyObject *name;
1635 };
1636 
1637 
1638 /* "View.MemoryView":330
1639  *
1640  * @cname('__pyx_memoryview')
1641  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1642  *
1643  * cdef object obj
1644  */
1645 struct __pyx_memoryview_obj {
1646  PyObject_HEAD
1647  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1648  PyObject *obj;
1649  PyObject *_size;
1650  PyObject *_array_interface;
1651  PyThread_type_lock lock;
1652  __pyx_atomic_int acquisition_count[2];
1653  __pyx_atomic_int *acquisition_count_aligned_p;
1654  Py_buffer view;
1655  int flags;
1656  int dtype_is_object;
1657  __Pyx_TypeInfo *typeinfo;
1658 };
1659 
1660 
1661 /* "View.MemoryView":965
1662  *
1663  * @cname('__pyx_memoryviewslice')
1664  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1665  * "Internal class for passing memoryview slices to Python"
1666  *
1667  */
1668 struct __pyx_memoryviewslice_obj {
1669  struct __pyx_memoryview_obj __pyx_base;
1670  __Pyx_memviewslice from_slice;
1671  PyObject *from_object;
1672  PyObject *(*to_object_func)(char *);
1673  int (*to_dtype_func)(char *, PyObject *);
1674 };
1675 
1676 
1677 
1678 /* "View.MemoryView":105
1679  *
1680  * @cname("__pyx_array")
1681  * cdef class array: # <<<<<<<<<<<<<<
1682  *
1683  * cdef:
1684  */
1685 
1686 struct __pyx_vtabstruct_array {
1687  PyObject *(*get_memview)(struct __pyx_array_obj *);
1688 };
1689 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1690 
1691 
1692 /* "View.MemoryView":330
1693  *
1694  * @cname('__pyx_memoryview')
1695  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1696  *
1697  * cdef object obj
1698  */
1699 
1700 struct __pyx_vtabstruct_memoryview {
1701  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1702  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1703  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1704  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1705  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1706  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1707  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1708 };
1709 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1710 
1711 
1712 /* "View.MemoryView":965
1713  *
1714  * @cname('__pyx_memoryviewslice')
1715  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1716  * "Internal class for passing memoryview slices to Python"
1717  *
1718  */
1719 
1720 struct __pyx_vtabstruct__memoryviewslice {
1721  struct __pyx_vtabstruct_memoryview __pyx_base;
1722 };
1723 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1724 
1725 /* --- Runtime support code (head) --- */
1726 /* Refnanny.proto */
1727 #ifndef CYTHON_REFNANNY
1728  #define CYTHON_REFNANNY 0
1729 #endif
1730 #if CYTHON_REFNANNY
1731  typedef struct {
1732  void (*INCREF)(void*, PyObject*, int);
1733  void (*DECREF)(void*, PyObject*, int);
1734  void (*GOTREF)(void*, PyObject*, int);
1735  void (*GIVEREF)(void*, PyObject*, int);
1736  void* (*SetupContext)(const char*, int, const char*);
1737  void (*FinishContext)(void**);
1738  } __Pyx_RefNannyAPIStruct;
1739  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1740  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1741  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1742 #ifdef WITH_THREAD
1743  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1744  if (acquire_gil) {\
1745  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1746  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1747  PyGILState_Release(__pyx_gilstate_save);\
1748  } else {\
1749  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1750  }
1751 #else
1752  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1753  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1754 #endif
1755  #define __Pyx_RefNannyFinishContext()\
1756  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1757  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1758  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1759  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1760  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1761  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1762  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1763  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1764  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1765 #else
1766  #define __Pyx_RefNannyDeclarations
1767  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1768  #define __Pyx_RefNannyFinishContext()
1769  #define __Pyx_INCREF(r) Py_INCREF(r)
1770  #define __Pyx_DECREF(r) Py_DECREF(r)
1771  #define __Pyx_GOTREF(r)
1772  #define __Pyx_GIVEREF(r)
1773  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1774  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1775  #define __Pyx_XGOTREF(r)
1776  #define __Pyx_XGIVEREF(r)
1777 #endif
1778 #define __Pyx_XDECREF_SET(r, v) do {\
1779  PyObject *tmp = (PyObject *) r;\
1780  r = v; __Pyx_XDECREF(tmp);\
1781  } while (0)
1782 #define __Pyx_DECREF_SET(r, v) do {\
1783  PyObject *tmp = (PyObject *) r;\
1784  r = v; __Pyx_DECREF(tmp);\
1785  } while (0)
1786 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1787 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1788 
1789 /* RaiseArgTupleInvalid.proto */
1790 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1791  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1792 
1793 /* RaiseDoubleKeywords.proto */
1794 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1795 
1796 /* ParseKeywords.proto */
1797 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1798  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1799  const char* function_name);
1800 
1801 /* ArgTypeTest.proto */
1802 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1803  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1804  __Pyx__ArgTypeTest(obj, type, name, exact))
1805 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1806 
1807 /* PyObjectGetAttrStr.proto */
1808 #if CYTHON_USE_TYPE_SLOTS
1809 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1810 #else
1811 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1812 #endif
1813 
1814 /* GetBuiltinName.proto */
1815 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1816 
1817 /* PyDictVersioning.proto */
1818 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1819 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1820 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1821 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1822  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1823  (cache_var) = (value);
1824 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1825  static PY_UINT64_T __pyx_dict_version = 0;\
1826  static PyObject *__pyx_dict_cached_value = NULL;\
1827  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1828  (VAR) = __pyx_dict_cached_value;\
1829  } else {\
1830  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1831  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1832  }\
1833 }
1834 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1835 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1836 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1837 #else
1838 #define __PYX_GET_DICT_VERSION(dict) (0)
1839 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1840 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1841 #endif
1842 
1843 /* GetModuleGlobalName.proto */
1844 #if CYTHON_USE_DICT_VERSIONS
1845 #define __Pyx_GetModuleGlobalName(var, name) {\
1846  static PY_UINT64_T __pyx_dict_version = 0;\
1847  static PyObject *__pyx_dict_cached_value = NULL;\
1848  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1849  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1850  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1851 }
1852 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1853  PY_UINT64_T __pyx_dict_version;\
1854  PyObject *__pyx_dict_cached_value;\
1855  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1856 }
1857 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1858 #else
1859 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1860 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1861 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1862 #endif
1863 
1864 /* PyIntBinop.proto */
1865 #if !CYTHON_COMPILING_IN_PYPY
1866 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1867 #else
1868 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1869  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1870 #endif
1871 
1872 /* PyCFunctionFastCall.proto */
1873 #if CYTHON_FAST_PYCCALL
1874 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1875 #else
1876 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1877 #endif
1878 
1879 /* PyFunctionFastCall.proto */
1880 #if CYTHON_FAST_PYCALL
1881 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1882  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1883 #if 1 || PY_VERSION_HEX < 0x030600B1
1884 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1885 #else
1886 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1887 #endif
1888 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1889  (sizeof(char [1 - 2*!(cond)]) - 1)
1890 #ifndef Py_MEMBER_SIZE
1891 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1892 #endif
1893  static size_t __pyx_pyframe_localsplus_offset = 0;
1894  #include "frameobject.h"
1895  #define __Pxy_PyFrame_Initialize_Offsets()\
1896  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1897  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1898  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1899  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1900 #endif
1901 
1902 /* PyObjectCall.proto */
1903 #if CYTHON_COMPILING_IN_CPYTHON
1904 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1905 #else
1906 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1907 #endif
1908 
1909 /* PyObjectCall2Args.proto */
1910 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1911 
1912 /* PyObjectCallMethO.proto */
1913 #if CYTHON_COMPILING_IN_CPYTHON
1914 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1915 #endif
1916 
1917 /* PyObjectCallOneArg.proto */
1918 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1919 
1920 /* PyObjectCallNoArg.proto */
1921 #if CYTHON_COMPILING_IN_CPYTHON
1922 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1923 #else
1924 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1925 #endif
1926 
1927 /* PyThreadStateGet.proto */
1928 #if CYTHON_FAST_THREAD_STATE
1929 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1930 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1931 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1932 #else
1933 #define __Pyx_PyThreadState_declare
1934 #define __Pyx_PyThreadState_assign
1935 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1936 #endif
1937 
1938 /* PyErrFetchRestore.proto */
1939 #if CYTHON_FAST_THREAD_STATE
1940 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1941 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1942 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1943 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1944 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1945 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1946 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1947 #if CYTHON_COMPILING_IN_CPYTHON
1948 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1949 #else
1950 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1951 #endif
1952 #else
1953 #define __Pyx_PyErr_Clear() PyErr_Clear()
1954 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1955 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1956 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1957 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1958 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1959 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1960 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1961 #endif
1962 
1963 /* RaiseException.proto */
1964 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1965 
1966 /* DictGetItem.proto */
1967 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1968 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1969 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1970  (likely(PyDict_CheckExact(obj)) ?\
1971  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1972 #else
1973 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1974 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1975 #endif
1976 
1977 /* RaiseTooManyValuesToUnpack.proto */
1978 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1979 
1980 /* RaiseNeedMoreValuesToUnpack.proto */
1981 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1982 
1983 /* RaiseNoneIterError.proto */
1984 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1985 
1986 /* ExtTypeTest.proto */
1987 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1988 
1989 /* GetTopmostException.proto */
1990 #if CYTHON_USE_EXC_INFO_STACK
1991 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1992 #endif
1993 
1994 /* SaveResetException.proto */
1995 #if CYTHON_FAST_THREAD_STATE
1996 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1997 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1998 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1999 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2000 #else
2001 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2002 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2003 #endif
2004 
2005 /* PyErrExceptionMatches.proto */
2006 #if CYTHON_FAST_THREAD_STATE
2007 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2008 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2009 #else
2010 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2011 #endif
2012 
2013 /* GetException.proto */
2014 #if CYTHON_FAST_THREAD_STATE
2015 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2016 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2017 #else
2018 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2019 #endif
2020 
2021 /* IncludeStringH.proto */
2022 #include <string.h>
2023 
2024 /* BytesEquals.proto */
2025 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2026 
2027 /* UnicodeEquals.proto */
2028 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2029 
2030 /* StrEquals.proto */
2031 #if PY_MAJOR_VERSION >= 3
2032 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2033 #else
2034 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2035 #endif
2036 
2037 /* None.proto */
2038 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2039 
2040 /* UnaryNegOverflows.proto */
2041 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2042  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2043 
2044 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2045 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2046 /* GetAttr.proto */
2047 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2048 
2049 /* GetItemInt.proto */
2050 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2051  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2052  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2053  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2054  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2055 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2056  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2057  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2058  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2059 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2060  int wraparound, int boundscheck);
2061 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2062  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2063  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2064  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2065 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2066  int wraparound, int boundscheck);
2067 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2068 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2069  int is_list, int wraparound, int boundscheck);
2070 
2071 /* ObjectGetItem.proto */
2072 #if CYTHON_USE_TYPE_SLOTS
2073 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2074 #else
2075 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2076 #endif
2077 
2078 /* decode_c_string_utf16.proto */
2079 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2080  int byteorder = 0;
2081  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2082 }
2083 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2084  int byteorder = -1;
2085  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2086 }
2087 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2088  int byteorder = 1;
2089  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2090 }
2091 
2092 /* decode_c_string.proto */
2093 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2094  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2095  const char* encoding, const char* errors,
2096  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2097 
2098 /* GetAttr3.proto */
2099 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2100 
2101 /* SwapException.proto */
2102 #if CYTHON_FAST_THREAD_STATE
2103 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2104 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2105 #else
2106 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2107 #endif
2108 
2109 /* Import.proto */
2110 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2111 
2112 /* FastTypeChecks.proto */
2113 #if CYTHON_COMPILING_IN_CPYTHON
2114 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2115 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2116 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2117 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2118 #else
2119 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2120 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2121 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2122 #endif
2123 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2124 
2125 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2126 /* ListCompAppend.proto */
2127 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2128 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2129  PyListObject* L = (PyListObject*) list;
2130  Py_ssize_t len = Py_SIZE(list);
2131  if (likely(L->allocated > len)) {
2132  Py_INCREF(x);
2133  PyList_SET_ITEM(list, len, x);
2134  Py_SIZE(list) = len+1;
2135  return 0;
2136  }
2137  return PyList_Append(list, x);
2138 }
2139 #else
2140 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2141 #endif
2142 
2143 /* ListExtend.proto */
2144 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2145 #if CYTHON_COMPILING_IN_CPYTHON
2146  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2147  if (unlikely(!none))
2148  return -1;
2149  Py_DECREF(none);
2150  return 0;
2151 #else
2152  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2153 #endif
2154 }
2155 
2156 /* ListAppend.proto */
2157 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2158 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2159  PyListObject* L = (PyListObject*) list;
2160  Py_ssize_t len = Py_SIZE(list);
2161  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2162  Py_INCREF(x);
2163  PyList_SET_ITEM(list, len, x);
2164  Py_SIZE(list) = len+1;
2165  return 0;
2166  }
2167  return PyList_Append(list, x);
2168 }
2169 #else
2170 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2171 #endif
2172 
2173 /* None.proto */
2174 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2175 
2176 /* None.proto */
2177 static CYTHON_INLINE long __Pyx_div_long(long, long);
2178 
2179 /* ImportFrom.proto */
2180 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2181 
2182 /* HasAttr.proto */
2183 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2184 
2185 /* StringJoin.proto */
2186 #if PY_MAJOR_VERSION < 3
2187 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
2188 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
2189 #else
2190 #define __Pyx_PyString_Join PyUnicode_Join
2191 #define __Pyx_PyBaseString_Join PyUnicode_Join
2192 #endif
2193 #if CYTHON_COMPILING_IN_CPYTHON
2194  #if PY_MAJOR_VERSION < 3
2195  #define __Pyx_PyBytes_Join _PyString_Join
2196  #else
2197  #define __Pyx_PyBytes_Join _PyBytes_Join
2198  #endif
2199 #else
2200 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2201 #endif
2202 
2203 /* PyObject_Unicode.proto */
2204 #if PY_MAJOR_VERSION >= 3
2205 #define __Pyx_PyObject_Unicode(obj)\
2206  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2207 #else
2208 #define __Pyx_PyObject_Unicode(obj)\
2209  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2210 #endif
2211 
2212 /* PyObject_GenericGetAttrNoDict.proto */
2213 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2214 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2215 #else
2216 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2217 #endif
2218 
2219 /* PyObject_GenericGetAttr.proto */
2220 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2221 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2222 #else
2223 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2224 #endif
2225 
2226 /* SetVTable.proto */
2227 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2228 
2229 /* SetupReduce.proto */
2230 static int __Pyx_setup_reduce(PyObject* type_obj);
2231 
2232 /* TypeImport.proto */
2233 #ifndef __PYX_HAVE_RT_ImportType_proto
2234 #define __PYX_HAVE_RT_ImportType_proto
2235 enum __Pyx_ImportType_CheckSize {
2236  __Pyx_ImportType_CheckSize_Error = 0,
2237  __Pyx_ImportType_CheckSize_Warn = 1,
2238  __Pyx_ImportType_CheckSize_Ignore = 2
2239 };
2240 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2241 #endif
2242 
2243 /* CLineInTraceback.proto */
2244 #ifdef CYTHON_CLINE_IN_TRACEBACK
2245 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2246 #else
2247 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2248 #endif
2249 
2250 /* CodeObjectCache.proto */
2251 typedef struct {
2252  PyCodeObject* code_object;
2253  int code_line;
2254 } __Pyx_CodeObjectCacheEntry;
2255 struct __Pyx_CodeObjectCache {
2256  int count;
2257  int max_count;
2258  __Pyx_CodeObjectCacheEntry* entries;
2259 };
2260 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2261 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2262 static PyCodeObject *__pyx_find_code_object(int code_line);
2263 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2264 
2265 /* AddTraceback.proto */
2266 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2267  int py_line, const char *filename);
2268 
2269 /* CIntToPy.proto */
2270 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2271 
2272 /* MemviewDtypeToObject.proto */
2273 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp);
2274 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj);
2275 
2276 /* RealImag.proto */
2277 #if CYTHON_CCOMPLEX
2278  #ifdef __cplusplus
2279  #define __Pyx_CREAL(z) ((z).real())
2280  #define __Pyx_CIMAG(z) ((z).imag())
2281  #else
2282  #define __Pyx_CREAL(z) (__real__(z))
2283  #define __Pyx_CIMAG(z) (__imag__(z))
2284  #endif
2285 #else
2286  #define __Pyx_CREAL(z) ((z).real)
2287  #define __Pyx_CIMAG(z) ((z).imag)
2288 #endif
2289 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2290  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2291  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2292  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2293 #else
2294  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2295  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2296 #endif
2297 
2298 /* Arithmetic.proto */
2299 #if CYTHON_CCOMPLEX
2300  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2301  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2302  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2303  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2304  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2305  #define __Pyx_c_neg_float(a) (-(a))
2306  #ifdef __cplusplus
2307  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2308  #define __Pyx_c_conj_float(z) (::std::conj(z))
2309  #if 1
2310  #define __Pyx_c_abs_float(z) (::std::abs(z))
2311  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2312  #endif
2313  #else
2314  #define __Pyx_c_is_zero_float(z) ((z)==0)
2315  #define __Pyx_c_conj_float(z) (conjf(z))
2316  #if 1
2317  #define __Pyx_c_abs_float(z) (cabsf(z))
2318  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2319  #endif
2320  #endif
2321 #else
2322  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2323  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2324  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2325  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2326  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2327  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2328  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2329  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2330  #if 1
2331  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2332  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2333  #endif
2334 #endif
2335 
2336 /* Arithmetic.proto */
2337 #if CYTHON_CCOMPLEX
2338  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2339  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2340  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2341  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2342  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2343  #define __Pyx_c_neg_double(a) (-(a))
2344  #ifdef __cplusplus
2345  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2346  #define __Pyx_c_conj_double(z) (::std::conj(z))
2347  #if 1
2348  #define __Pyx_c_abs_double(z) (::std::abs(z))
2349  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2350  #endif
2351  #else
2352  #define __Pyx_c_is_zero_double(z) ((z)==0)
2353  #define __Pyx_c_conj_double(z) (conj(z))
2354  #if 1
2355  #define __Pyx_c_abs_double(z) (cabs(z))
2356  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2357  #endif
2358  #endif
2359 #else
2360  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2361  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2362  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2363  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2364  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2365  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2366  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2367  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2368  #if 1
2369  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2370  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2371  #endif
2372 #endif
2373 
2374 /* CIntToPy.proto */
2375 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2376 
2377 #if PY_MAJOR_VERSION < 3
2378  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2379  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2380 #else
2381  #define __Pyx_GetBuffer PyObject_GetBuffer
2382  #define __Pyx_ReleaseBuffer PyBuffer_Release
2383 #endif
2384 
2385 
2386 /* BufferStructDeclare.proto */
2387 typedef struct {
2388  Py_ssize_t shape, strides, suboffsets;
2389 } __Pyx_Buf_DimInfo;
2390 typedef struct {
2391  size_t refcount;
2392  Py_buffer pybuffer;
2393 } __Pyx_Buffer;
2394 typedef struct {
2395  __Pyx_Buffer *rcbuffer;
2396  char *data;
2397  __Pyx_Buf_DimInfo diminfo[8];
2398 } __Pyx_LocalBuf_ND;
2399 
2400 /* MemviewSliceIsContig.proto */
2401 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2402 
2403 /* OverlappingSlices.proto */
2404 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2405  __Pyx_memviewslice *slice2,
2406  int ndim, size_t itemsize);
2407 
2408 /* Capsule.proto */
2409 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2410 
2411 /* CIntFromPy.proto */
2412 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2413 
2414 /* TypeInfoToFormat.proto */
2415 struct __pyx_typeinfo_string {
2416  char string[3];
2417 };
2418 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2419 
2420 /* MemviewSliceCopyTemplate.proto */
2421 static __Pyx_memviewslice
2422 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2423  const char *mode, int ndim,
2424  size_t sizeof_dtype, int contig_flag,
2425  int dtype_is_object);
2426 
2427 /* MemviewSliceInit.proto */
2428 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2429 #define __Pyx_MEMVIEW_DIRECT 1
2430 #define __Pyx_MEMVIEW_PTR 2
2431 #define __Pyx_MEMVIEW_FULL 4
2432 #define __Pyx_MEMVIEW_CONTIG 8
2433 #define __Pyx_MEMVIEW_STRIDED 16
2434 #define __Pyx_MEMVIEW_FOLLOW 32
2435 #define __Pyx_IS_C_CONTIG 1
2436 #define __Pyx_IS_F_CONTIG 2
2437 static int __Pyx_init_memviewslice(
2438  struct __pyx_memoryview_obj *memview,
2439  int ndim,
2440  __Pyx_memviewslice *memviewslice,
2441  int memview_is_new_reference);
2442 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2443  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2444 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2445  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2446 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2447 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2448 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2449 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2450 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2451 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2452 
2453 /* CIntFromPy.proto */
2454 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2455 
2456 /* CIntToPy.proto */
2457 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2458 
2459 /* CIntFromPy.proto */
2460 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2461 
2462 /* CheckBinaryVersion.proto */
2463 static int __Pyx_check_binary_version(void);
2464 
2465 /* InitStrings.proto */
2466 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2467 
2468 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2469 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2470 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2471 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2472 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2473 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2474 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2475 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2476 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2477 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2478 
2479 /* Module declarations from 'cpython.buffer' */
2480 
2481 /* Module declarations from 'libc.string' */
2482 
2483 /* Module declarations from 'libc.stdio' */
2484 
2485 /* Module declarations from '__builtin__' */
2486 
2487 /* Module declarations from 'cpython.type' */
2488 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2489 
2490 /* Module declarations from 'cpython' */
2491 
2492 /* Module declarations from 'cpython.object' */
2493 
2494 /* Module declarations from 'cpython.ref' */
2495 
2496 /* Module declarations from 'cpython.mem' */
2497 
2498 /* Module declarations from 'numpy' */
2499 
2500 /* Module declarations from 'numpy' */
2501 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2502 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2503 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2504 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2505 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2506 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2507 
2508 /* Module declarations from 'mpi4py.libmpi' */
2509 
2510 /* Module declarations from 'mpi4py.MPI' */
2511 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Status = 0;
2512 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Datatype = 0;
2513 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Request = 0;
2514 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Prequest = 0;
2515 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Grequest = 0;
2516 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Message = 0;
2517 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Op = 0;
2518 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Group = 0;
2519 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Info = 0;
2520 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Errhandler = 0;
2521 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Comm = 0;
2522 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intracomm = 0;
2523 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Topocomm = 0;
2524 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Cartcomm = 0;
2525 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Graphcomm = 0;
2526 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Distgraphcomm = 0;
2527 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intercomm = 0;
2528 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Win = 0;
2529 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_File = 0;
2530 
2531 /* Module declarations from 'libcpp' */
2532 
2533 /* Module declarations from 'mesh' */
2534 
2535 /* Module declarations from 'proteus' */
2536 
2537 /* Module declarations from 'proteus.mesh' */
2538 
2539 /* Module declarations from 'proteus.cmeshTools' */
2540 static PyTypeObject *__pyx_ptype_7proteus_10cmeshTools_CMesh = 0;
2541 
2542 /* Module declarations from 'proteus.partitioning' */
2543 
2544 /* Module declarations from 'cpartitioning' */
2545 static PyTypeObject *__pyx_array_type = 0;
2546 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2547 static PyTypeObject *__pyx_memoryview_type = 0;
2548 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2549 static PyObject *generic = 0;
2550 static PyObject *strided = 0;
2551 static PyObject *indirect = 0;
2552 static PyObject *contiguous = 0;
2553 static PyObject *indirect_contiguous = 0;
2554 static int __pyx_memoryview_thread_locks_used;
2555 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2556 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2557 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2558 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2559 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2560 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2561 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2562 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2563 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2564 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2565 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2566 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2567 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2568 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2569 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2570 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2571 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2572 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2573 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2574 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2575 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2576 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2577 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2578 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2579 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2580 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2581 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2582 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2583 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2584 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2585 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2586 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2587 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2588 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2589 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
2590 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2591 #define __Pyx_MODULE_NAME "cpartitioning"
2592 extern int __pyx_module_is_main_cpartitioning;
2593 int __pyx_module_is_main_cpartitioning = 0;
2594 
2595 /* Implementation of 'cpartitioning' */
2596 static PyObject *__pyx_builtin_ValueError;
2597 static PyObject *__pyx_builtin_range;
2598 static PyObject *__pyx_builtin_RuntimeError;
2599 static PyObject *__pyx_builtin_ImportError;
2600 static PyObject *__pyx_builtin_MemoryError;
2601 static PyObject *__pyx_builtin_enumerate;
2602 static PyObject *__pyx_builtin_TypeError;
2603 static PyObject *__pyx_builtin_Ellipsis;
2604 static PyObject *__pyx_builtin_id;
2605 static PyObject *__pyx_builtin_IndexError;
2606 static const char __pyx_k_O[] = "O";
2607 static const char __pyx_k_T[] = "T{";
2608  static const char __pyx_k_c[] = "c";
2609  static const char __pyx_k_s[] = "(%s)";
2610  static const char __pyx_k_id[] = "id";
2611  static const char __pyx_k_np[] = "np";
2612  static const char __pyx_k__26[] = "^";
2613  static const char __pyx_k__27[] = "";
2614  static const char __pyx_k__28[] = ":";
2615 static const char __pyx_k__29[] = "}";
2616 static const char __pyx_k__30[] = ",";
2617 static const char __pyx_k_new[] = "__new__";
2618 static const char __pyx_k_obj[] = "obj";
2619 static const char __pyx_k_Comm[] = "Comm";
2620 static const char __pyx_k_base[] = "base";
2621 static const char __pyx_k_comm[] = "comm";
2622 static const char __pyx_k_dict[] = "__dict__";
2623 static const char __pyx_k_join[] = "join";
2624 static const char __pyx_k_main[] = "__main__";
2625 static const char __pyx_k_mode[] = "mode";
2626 static const char __pyx_k_name[] = "name";
2627 static const char __pyx_k_ndim[] = "ndim";
2628 static const char __pyx_k_pack[] = "pack";
2629 static const char __pyx_k_size[] = "size";
2630 static const char __pyx_k_step[] = "step";
2631 static const char __pyx_k_stop[] = "stop";
2632 static const char __pyx_k_test[] = "__test__";
2633 static const char __pyx_k_ASCII[] = "ASCII";
2634 static const char __pyx_k_class[] = "__class__";
2635 static const char __pyx_k_cmesh[] = "cmesh";
2636 static const char __pyx_k_error[] = "error";
2637 static const char __pyx_k_flags[] = "flags";
2638 static const char __pyx_k_numpy[] = "numpy";
2639 static const char __pyx_k_range[] = "range";
2640 static const char __pyx_k_shape[] = "shape";
2641 static const char __pyx_k_start[] = "start";
2642 static const char __pyx_k_encode[] = "encode";
2643 static const char __pyx_k_format[] = "format";
2644 static const char __pyx_k_import[] = "__import__";
2645 static const char __pyx_k_nSpace[] = "nSpace";
2646 static const char __pyx_k_name_2[] = "__name__";
2647 static const char __pyx_k_pickle[] = "pickle";
2648 static const char __pyx_k_reduce[] = "__reduce__";
2649 static const char __pyx_k_struct[] = "struct";
2650 static const char __pyx_k_unpack[] = "unpack";
2651 static const char __pyx_k_update[] = "update";
2652 static const char __pyx_k_asarray[] = "asarray";
2653 static const char __pyx_k_fortran[] = "fortran";
2654 static const char __pyx_k_memview[] = "memview";
2655 static const char __pyx_k_proteus[] = "proteus";
2656 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2657 static const char __pyx_k_filebase[] = "filebase";
2658 static const char __pyx_k_getstate[] = "__getstate__";
2659 static const char __pyx_k_itemsize[] = "itemsize";
2660 static const char __pyx_k_pyx_type[] = "__pyx_type";
2661 static const char __pyx_k_setstate[] = "__setstate__";
2662 static const char __pyx_k_TypeError[] = "TypeError";
2663 static const char __pyx_k_enumerate[] = "enumerate";
2664 static const char __pyx_k_indexBase[] = "indexBase";
2665 static const char __pyx_k_pyx_state[] = "__pyx_state";
2666 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2667 static const char __pyx_k_IndexError[] = "IndexError";
2668 static const char __pyx_k_ValueError[] = "ValueError";
2669 static const char __pyx_k_pyx_result[] = "__pyx_result";
2670 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2671 static const char __pyx_k_ImportError[] = "ImportError";
2672 static const char __pyx_k_MemoryError[] = "MemoryError";
2673 static const char __pyx_k_PickleError[] = "PickleError";
2674 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2675 static const char __pyx_k_nDOF_element[] = "nDOF_element";
2676 static const char __pyx_k_proteus_Comm[] = "proteus_Comm";
2677 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2678 static const char __pyx_k_stringsource[] = "stringsource";
2679 static const char __pyx_k_cpartitioning[] = "cpartitioning";
2680 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2681 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2682 static const char __pyx_k_nDOF_subdomain[] = "nDOF_subdomain";
2683 static const char __pyx_k_partitionNodes[] = "partitionNodes";
2684 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2685 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2686 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2687 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2688 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2689 static const char __pyx_k_subdomain_cmesh[] = "subdomain_cmesh";
2690 static const char __pyx_k_dg_subdomain_l2g[] = "dg_subdomain_l2g";
2691 static const char __pyx_k_nLayersOfOverlap[] = "nLayersOfOverlap";
2692 static const char __pyx_k_max_dof_neighbors[] = "max_dof_neighbors";
2693 static const char __pyx_k_partitionElements[] = "partitionElements";
2694 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2695 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2696 static const char __pyx_k_nDOF_all_processes[] = "nDOF_all_processes";
2697 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2698 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2699 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2700 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2701 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2702 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2703 static const char __pyx_k_quadratic_lagrangeNodes[] = "quadratic_lagrangeNodes";
2704 static const char __pyx_k_quadratic_subdomain_l2g[] = "quadratic_subdomain_l2g";
2705 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2706 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2707 static const char __pyx_k_proteus_cpartitioning_pyx[] = "proteus/cpartitioning.pyx";
2708 static const char __pyx_k_edgeOffsets_subdomain_owned[] = "edgeOffsets_subdomain_owned";
2709 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2710 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2711 static const char __pyx_k_nodeOffsets_subdomain_owned[] = "nodeOffsets_subdomain_owned";
2712 static const char __pyx_k_convertPUMIPartitionToPython[] = "convertPUMIPartitionToPython";
2713 static const char __pyx_k_dgNumbering_subdomain2global[] = "dgNumbering_subdomain2global";
2714 static const char __pyx_k_partitionNodesFromTetgenFiles[] = "partitionNodesFromTetgenFiles";
2715 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2716 static const char __pyx_k_dg_dof_offsets_subdomain_owned[] = "dg_dof_offsets_subdomain_owned";
2717 static const char __pyx_k_edgeNumbering_subdomain2global[] = "edgeNumbering_subdomain2global";
2718 static const char __pyx_k_elementOffsets_subdomain_owned[] = "elementOffsets_subdomain_owned";
2719 static const char __pyx_k_nodeNumbering_subdomain2global[] = "nodeNumbering_subdomain2global";
2720 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2721 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2722 static const char __pyx_k_quadratic_dof_offsets_subdomain[] = "quadratic_dof_offsets_subdomain_owned";
2723 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2724 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2725 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2726 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2727 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2728 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2729 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2730 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2731 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2732 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2733 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2734 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2735 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2736 static const char __pyx_k_buildDiscontinuousGalerkinLocal2[] = "buildDiscontinuousGalerkinLocal2GlobalMappings";
2737 static const char __pyx_k_buildQuadraticCubeLocal2GlobalMa[] = "buildQuadraticCubeLocal2GlobalMappings";
2738 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob[] = "buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!";
2739 static const char __pyx_k_buildQuadraticLocal2GlobalMappin[] = "buildQuadraticLocal2GlobalMappings";
2740 static const char __pyx_k_elementBoundaryNumbering_subdoma[] = "elementBoundaryNumbering_subdomain2global";
2741 static const char __pyx_k_elementBoundaryOffsets_subdomain[] = "elementBoundaryOffsets_subdomain_owned";
2742 static const char __pyx_k_elementNumbering_subdomain2globa[] = "elementNumbering_subdomain2global";
2743 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2744 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2745 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2746 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2747 static const char __pyx_k_quadraticNumbering_subdomain2glo[] = "quadraticNumbering_subdomain2global";
2748 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2749 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2750 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob_2[] = "buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!";
2751 static PyObject *__pyx_n_s_ASCII;
2752 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2753 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2754 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2755 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2756 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2757 static PyObject *__pyx_n_s_Comm;
2758 static PyObject *__pyx_n_s_Ellipsis;
2759 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2760 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2761 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2762 static PyObject *__pyx_n_s_ImportError;
2763 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2764 static PyObject *__pyx_n_s_IndexError;
2765 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2766 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2767 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2768 static PyObject *__pyx_n_s_MemoryError;
2769 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2770 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2771 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2772 static PyObject *__pyx_n_b_O;
2773 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2774 static PyObject *__pyx_n_s_PickleError;
2775 static PyObject *__pyx_n_s_RuntimeError;
2776 static PyObject *__pyx_kp_b_T;
2777 static PyObject *__pyx_n_s_TypeError;
2778 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2779 static PyObject *__pyx_n_s_ValueError;
2780 static PyObject *__pyx_n_s_View_MemoryView;
2781 static PyObject *__pyx_kp_b__26;
2782 static PyObject *__pyx_kp_b__27;
2783 static PyObject *__pyx_kp_b__28;
2784 static PyObject *__pyx_kp_b__29;
2785 static PyObject *__pyx_kp_u__30;
2786 static PyObject *__pyx_n_s_allocate_buffer;
2787 static PyObject *__pyx_n_s_asarray;
2788 static PyObject *__pyx_n_s_base;
2789 static PyObject *__pyx_n_s_buildDiscontinuousGalerkinLocal2;
2790 static PyObject *__pyx_n_s_buildQuadraticCubeLocal2GlobalMa;
2791 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob;
2792 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2;
2793 static PyObject *__pyx_n_s_buildQuadraticLocal2GlobalMappin;
2794 static PyObject *__pyx_n_s_c;
2795 static PyObject *__pyx_n_u_c;
2796 static PyObject *__pyx_n_s_class;
2797 static PyObject *__pyx_n_s_cline_in_traceback;
2798 static PyObject *__pyx_n_s_cmesh;
2799 static PyObject *__pyx_n_s_comm;
2800 static PyObject *__pyx_kp_s_contiguous_and_direct;
2801 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2802 static PyObject *__pyx_n_s_convertPUMIPartitionToPython;
2803 static PyObject *__pyx_n_s_cpartitioning;
2804 static PyObject *__pyx_n_s_dgNumbering_subdomain2global;
2805 static PyObject *__pyx_n_s_dg_dof_offsets_subdomain_owned;
2806 static PyObject *__pyx_n_s_dg_subdomain_l2g;
2807 static PyObject *__pyx_n_s_dict;
2808 static PyObject *__pyx_n_s_dtype_is_object;
2809 static PyObject *__pyx_n_s_edgeNumbering_subdomain2global;
2810 static PyObject *__pyx_n_s_edgeOffsets_subdomain_owned;
2811 static PyObject *__pyx_n_s_elementBoundaryNumbering_subdoma;
2812 static PyObject *__pyx_n_s_elementBoundaryOffsets_subdomain;
2813 static PyObject *__pyx_n_s_elementNumbering_subdomain2globa;
2814 static PyObject *__pyx_n_s_elementOffsets_subdomain_owned;
2815 static PyObject *__pyx_n_s_encode;
2816 static PyObject *__pyx_n_s_enumerate;
2817 static PyObject *__pyx_n_s_error;
2818 static PyObject *__pyx_n_s_filebase;
2819 static PyObject *__pyx_n_s_flags;
2820 static PyObject *__pyx_n_s_format;
2821 static PyObject *__pyx_n_s_fortran;
2822 static PyObject *__pyx_n_u_fortran;
2823 static PyObject *__pyx_n_s_getstate;
2824 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2825 static PyObject *__pyx_n_s_id;
2826 static PyObject *__pyx_n_s_import;
2827 static PyObject *__pyx_n_s_indexBase;
2828 static PyObject *__pyx_n_s_itemsize;
2829 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2830 static PyObject *__pyx_n_s_join;
2831 static PyObject *__pyx_n_s_main;
2832 static PyObject *__pyx_n_s_max_dof_neighbors;
2833 static PyObject *__pyx_n_s_memview;
2834 static PyObject *__pyx_n_s_mode;
2835 static PyObject *__pyx_n_s_nDOF_all_processes;
2836 static PyObject *__pyx_n_s_nDOF_element;
2837 static PyObject *__pyx_n_s_nDOF_subdomain;
2838 static PyObject *__pyx_n_s_nLayersOfOverlap;
2839 static PyObject *__pyx_n_s_nSpace;
2840 static PyObject *__pyx_n_s_name;
2841 static PyObject *__pyx_n_s_name_2;
2842 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2843 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2844 static PyObject *__pyx_n_s_ndim;
2845 static PyObject *__pyx_n_s_new;
2846 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2847 static PyObject *__pyx_n_s_nodeNumbering_subdomain2global;
2848 static PyObject *__pyx_n_s_nodeOffsets_subdomain_owned;
2849 static PyObject *__pyx_n_s_np;
2850 static PyObject *__pyx_n_s_numpy;
2851 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2852 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2853 static PyObject *__pyx_n_s_obj;
2854 static PyObject *__pyx_n_s_pack;
2855 static PyObject *__pyx_n_s_partitionElements;
2856 static PyObject *__pyx_n_s_partitionNodes;
2857 static PyObject *__pyx_n_s_partitionNodesFromTetgenFiles;
2858 static PyObject *__pyx_n_s_pickle;
2859 static PyObject *__pyx_n_s_proteus;
2860 static PyObject *__pyx_n_s_proteus_Comm;
2861 static PyObject *__pyx_kp_s_proteus_cpartitioning_pyx;
2862 static PyObject *__pyx_n_s_pyx_PickleError;
2863 static PyObject *__pyx_n_s_pyx_checksum;
2864 static PyObject *__pyx_n_s_pyx_getbuffer;
2865 static PyObject *__pyx_n_s_pyx_result;
2866 static PyObject *__pyx_n_s_pyx_state;
2867 static PyObject *__pyx_n_s_pyx_type;
2868 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2869 static PyObject *__pyx_n_s_pyx_vtable;
2870 static PyObject *__pyx_n_s_quadraticNumbering_subdomain2glo;
2871 static PyObject *__pyx_n_s_quadratic_dof_offsets_subdomain;
2872 static PyObject *__pyx_n_s_quadratic_lagrangeNodes;
2873 static PyObject *__pyx_n_s_quadratic_subdomain_l2g;
2874 static PyObject *__pyx_n_s_range;
2875 static PyObject *__pyx_n_s_reduce;
2876 static PyObject *__pyx_n_s_reduce_cython;
2877 static PyObject *__pyx_n_s_reduce_ex;
2878 static PyObject *__pyx_kp_u_s;
2879 static PyObject *__pyx_n_s_setstate;
2880 static PyObject *__pyx_n_s_setstate_cython;
2881 static PyObject *__pyx_n_s_shape;
2882 static PyObject *__pyx_n_s_size;
2883 static PyObject *__pyx_n_s_start;
2884 static PyObject *__pyx_n_s_step;
2885 static PyObject *__pyx_n_s_stop;
2886 static PyObject *__pyx_kp_s_strided_and_direct;
2887 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2888 static PyObject *__pyx_kp_s_strided_and_indirect;
2889 static PyObject *__pyx_kp_s_stringsource;
2890 static PyObject *__pyx_n_s_struct;
2891 static PyObject *__pyx_n_s_subdomain_cmesh;
2892 static PyObject *__pyx_n_s_test;
2893 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2894 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2895 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2896 static PyObject *__pyx_n_s_unpack;
2897 static PyObject *__pyx_n_s_update;
2898 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2899 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2900 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2901 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2902 static PyObject *__pyx_pf_13cpartitioning_8buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes); /* proto */
2903 static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes); /* proto */
2904 static PyObject *__pyx_pf_13cpartitioning_12buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nDOF_element, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global); /* proto */
2905 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2906 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2907 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2908 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2909 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2910 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2911 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2912 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2913 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2914 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2915 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2916 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2917 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2918 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2919 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2920 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2921 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2922 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2923 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2924 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2925 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2926 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2927 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2928 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2929 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2930 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2931 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2932 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2933 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2934 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2935 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2936 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2937 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2938 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2939 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2940 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2941 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2942 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2943 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2944 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2945 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2946 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2947 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2948 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2949 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2950 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2951 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2952 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2953 static PyObject *__pyx_int_0;
2954 static PyObject *__pyx_int_1;
2955 static PyObject *__pyx_int_184977713;
2956 static PyObject *__pyx_int_neg_1;
2957 static PyObject *__pyx_tuple_;
2958 static PyObject *__pyx_tuple__2;
2959 static PyObject *__pyx_tuple__3;
2960 static PyObject *__pyx_tuple__4;
2961 static PyObject *__pyx_tuple__5;
2962 static PyObject *__pyx_tuple__6;
2963 static PyObject *__pyx_tuple__7;
2964 static PyObject *__pyx_tuple__8;
2965 static PyObject *__pyx_tuple__9;
2966 static PyObject *__pyx_slice__22;
2967 static PyObject *__pyx_tuple__10;
2968 static PyObject *__pyx_tuple__11;
2969 static PyObject *__pyx_tuple__12;
2970 static PyObject *__pyx_tuple__13;
2971 static PyObject *__pyx_tuple__14;
2972 static PyObject *__pyx_tuple__15;
2973 static PyObject *__pyx_tuple__16;
2974 static PyObject *__pyx_tuple__17;
2975 static PyObject *__pyx_tuple__18;
2976 static PyObject *__pyx_tuple__19;
2977 static PyObject *__pyx_tuple__20;
2978 static PyObject *__pyx_tuple__21;
2979 static PyObject *__pyx_tuple__23;
2980 static PyObject *__pyx_tuple__24;
2981 static PyObject *__pyx_tuple__25;
2982 static PyObject *__pyx_tuple__31;
2983 static PyObject *__pyx_tuple__33;
2984 static PyObject *__pyx_tuple__35;
2985 static PyObject *__pyx_tuple__37;
2986 static PyObject *__pyx_tuple__39;
2987 static PyObject *__pyx_tuple__41;
2988 static PyObject *__pyx_tuple__43;
2989 static PyObject *__pyx_tuple__45;
2990 static PyObject *__pyx_tuple__46;
2991 static PyObject *__pyx_tuple__47;
2992 static PyObject *__pyx_tuple__48;
2993 static PyObject *__pyx_tuple__49;
2994 static PyObject *__pyx_tuple__50;
2995 static PyObject *__pyx_codeobj__32;
2996 static PyObject *__pyx_codeobj__34;
2997 static PyObject *__pyx_codeobj__36;
2998 static PyObject *__pyx_codeobj__38;
2999 static PyObject *__pyx_codeobj__40;
3000 static PyObject *__pyx_codeobj__42;
3001 static PyObject *__pyx_codeobj__44;
3002 static PyObject *__pyx_codeobj__51;
3003 /* Late includes */
3004 
3005 /* "cpartitioning.pyx":19
3006  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
3007  *
3008  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3009  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3010  * c_partitionElements(comm.ob_mpi,
3011  */
3012 
3013 /* Python wrapper */
3014 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3015 static PyMethodDef __pyx_mdef_13cpartitioning_1partitionElements = {"partitionElements", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_1partitionElements, METH_VARARGS|METH_KEYWORDS, 0};
3016 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3017  struct PyMPICommObject *__pyx_v_comm = 0;
3018  int __pyx_v_nLayersOfOverlap;
3019  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3020  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3021  PyObject *__pyx_r = 0;
3022  __Pyx_RefNannyDeclarations
3023  __Pyx_RefNannySetupContext("partitionElements (wrapper)", 0);
3024  {
3025  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3026  PyObject* values[4] = {0,0,0,0};
3027  if (unlikely(__pyx_kwds)) {
3028  Py_ssize_t kw_args;
3029  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3030  switch (pos_args) {
3031  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3032  CYTHON_FALLTHROUGH;
3033  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3034  CYTHON_FALLTHROUGH;
3035  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3036  CYTHON_FALLTHROUGH;
3037  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3038  CYTHON_FALLTHROUGH;
3039  case 0: break;
3040  default: goto __pyx_L5_argtuple_error;
3041  }
3042  kw_args = PyDict_Size(__pyx_kwds);
3043  switch (pos_args) {
3044  case 0:
3045  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3046  else goto __pyx_L5_argtuple_error;
3047  CYTHON_FALLTHROUGH;
3048  case 1:
3049  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3050  else {
3051  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 1); __PYX_ERR(0, 19, __pyx_L3_error)
3052  }
3053  CYTHON_FALLTHROUGH;
3054  case 2:
3055  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3056  else {
3057  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 2); __PYX_ERR(0, 19, __pyx_L3_error)
3058  }
3059  CYTHON_FALLTHROUGH;
3060  case 3:
3061  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3062  else {
3063  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 3); __PYX_ERR(0, 19, __pyx_L3_error)
3064  }
3065  }
3066  if (unlikely(kw_args > 0)) {
3067  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionElements") < 0)) __PYX_ERR(0, 19, __pyx_L3_error)
3068  }
3069  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3070  goto __pyx_L5_argtuple_error;
3071  } else {
3072  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3073  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3074  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3075  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3076  }
3077  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
3078  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
3079  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3080  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3081  }
3082  goto __pyx_L4_argument_unpacking_done;
3083  __pyx_L5_argtuple_error:;
3084  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 19, __pyx_L3_error)
3085  __pyx_L3_error:;
3086  __Pyx_AddTraceback("cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3087  __Pyx_RefNannyFinishContext();
3088  return NULL;
3089  __pyx_L4_argument_unpacking_done:;
3090  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
3091  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
3092  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
3093  __pyx_r = __pyx_pf_13cpartitioning_partitionElements(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3094 
3095  /* function exit code */
3096  goto __pyx_L0;
3097  __pyx_L1_error:;
3098  __pyx_r = NULL;
3099  __pyx_L0:;
3100  __Pyx_RefNannyFinishContext();
3101  return __pyx_r;
3102 }
3103 
3104 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3105  PyObject *__pyx_r = NULL;
3106  __Pyx_RefNannyDeclarations
3107  PyObject *__pyx_t_1 = NULL;
3108  PyObject *__pyx_t_2 = NULL;
3109  PyObject *__pyx_t_3 = NULL;
3110  int *__pyx_t_4;
3111  PyObject *__pyx_t_5 = NULL;
3112  Py_ssize_t __pyx_t_6;
3113  struct __pyx_array_obj *__pyx_t_7 = NULL;
3114  PyObject *__pyx_t_8 = NULL;
3115  PyObject *__pyx_t_9 = NULL;
3116  PyObject *__pyx_t_10 = NULL;
3117  PyObject *__pyx_t_11 = NULL;
3118  PyObject *__pyx_t_12 = NULL;
3119  PyObject *__pyx_t_13 = NULL;
3120  PyObject *__pyx_t_14 = NULL;
3121  __Pyx_RefNannySetupContext("partitionElements", 0);
3122 
3123  /* "cpartitioning.pyx":20
3124  *
3125  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3126  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
3127  * c_partitionElements(comm.ob_mpi,
3128  * cmesh.mesh,
3129  */
3130  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3131 
3132  /* "cpartitioning.pyx":21
3133  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3134  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3135  * c_partitionElements(comm.ob_mpi, # <<<<<<<<<<<<<<
3136  * cmesh.mesh,
3137  * nLayersOfOverlap)
3138  */
3139  (void)(proteus::partitionElements(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
3140 
3141  /* "cpartitioning.pyx":24
3142  * cmesh.mesh,
3143  * nLayersOfOverlap)
3144  * return ( # <<<<<<<<<<<<<<
3145  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3146  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3147  */
3148  __Pyx_XDECREF(__pyx_r);
3149 
3150  /* "cpartitioning.pyx":25
3151  * nLayersOfOverlap)
3152  * return (
3153  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3154  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3155  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3156  */
3157  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3158  __Pyx_GOTREF(__pyx_t_2);
3159  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3160  __Pyx_GOTREF(__pyx_t_3);
3161  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3162  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3163  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3164  __Pyx_GOTREF(__pyx_t_2);
3165  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 25, __pyx_L1_error)
3166  __Pyx_GOTREF(__pyx_t_5);
3167  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3168  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 25, __pyx_L1_error)
3169  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3170  if (!__pyx_t_4) {
3171  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3172  __PYX_ERR(0, 25, __pyx_L1_error)
3173  }
3174  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3175  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3176  if (unlikely(!__pyx_t_2 || !__pyx_t_5 || !PyBytes_AsString(__pyx_t_2))) __PYX_ERR(0, 25, __pyx_L1_error)
3177  __Pyx_GOTREF(__pyx_t_2);
3178  __Pyx_GOTREF(__pyx_t_5);
3179  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
3180  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 25, __pyx_L1_error)
3181  __Pyx_GOTREF(__pyx_t_7);
3182  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3183  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3184  __pyx_t_2 = NULL;
3185  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3186  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3187  if (likely(__pyx_t_2)) {
3188  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3189  __Pyx_INCREF(__pyx_t_2);
3190  __Pyx_INCREF(function);
3191  __Pyx_DECREF_SET(__pyx_t_3, function);
3192  }
3193  }
3194  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3195  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3196  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3197  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
3198  __Pyx_GOTREF(__pyx_t_1);
3199  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3200 
3201  /* "cpartitioning.pyx":26
3202  * return (
3203  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3204  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
3205  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3206  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3207  */
3208  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3209  __Pyx_GOTREF(__pyx_t_2);
3210  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
3211  __Pyx_GOTREF(__pyx_t_5);
3212  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3213  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3214  if (!__pyx_t_4) {
3215  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3216  __PYX_ERR(0, 26, __pyx_L1_error)
3217  }
3218  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3219  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
3220  if (unlikely(!__pyx_t_8 || !__pyx_t_2 || !PyBytes_AsString(__pyx_t_8))) __PYX_ERR(0, 26, __pyx_L1_error)
3221  __Pyx_GOTREF(__pyx_t_8);
3222  __Pyx_GOTREF(__pyx_t_2);
3223  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3224  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L1_error)
3225  __Pyx_GOTREF(__pyx_t_7);
3226  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3227  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3228  __pyx_t_8 = NULL;
3229  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3230  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3231  if (likely(__pyx_t_8)) {
3232  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3233  __Pyx_INCREF(__pyx_t_8);
3234  __Pyx_INCREF(function);
3235  __Pyx_DECREF_SET(__pyx_t_5, function);
3236  }
3237  }
3238  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3239  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3240  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3241  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
3242  __Pyx_GOTREF(__pyx_t_3);
3243  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3244 
3245  /* "cpartitioning.pyx":27
3246  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3247  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3248  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3249  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3250  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3251  */
3252  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 27, __pyx_L1_error)
3253  __Pyx_GOTREF(__pyx_t_8);
3254  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3255  __Pyx_GOTREF(__pyx_t_2);
3256  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3257  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3258  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 27, __pyx_L1_error)
3259  __Pyx_GOTREF(__pyx_t_8);
3260  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 27, __pyx_L1_error)
3261  __Pyx_GOTREF(__pyx_t_9);
3262  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3263  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L1_error)
3264  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3265  if (!__pyx_t_4) {
3266  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3267  __PYX_ERR(0, 27, __pyx_L1_error)
3268  }
3269  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3270  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3271  if (unlikely(!__pyx_t_8 || !__pyx_t_9 || !PyBytes_AsString(__pyx_t_8))) __PYX_ERR(0, 27, __pyx_L1_error)
3272  __Pyx_GOTREF(__pyx_t_8);
3273  __Pyx_GOTREF(__pyx_t_9);
3274  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3275  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error)
3276  __Pyx_GOTREF(__pyx_t_7);
3277  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3278  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3279  __pyx_t_8 = NULL;
3280  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3281  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3282  if (likely(__pyx_t_8)) {
3283  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3284  __Pyx_INCREF(__pyx_t_8);
3285  __Pyx_INCREF(function);
3286  __Pyx_DECREF_SET(__pyx_t_2, function);
3287  }
3288  }
3289  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
3290  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3291  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3292  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
3293  __Pyx_GOTREF(__pyx_t_5);
3294  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3295 
3296  /* "cpartitioning.pyx":28
3297  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3298  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3299  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
3300  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3301  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3302  */
3303  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3304  __Pyx_GOTREF(__pyx_t_8);
3305  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 28, __pyx_L1_error)
3306  __Pyx_GOTREF(__pyx_t_9);
3307  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3308  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
3309  if (!__pyx_t_4) {
3310  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3311  __PYX_ERR(0, 28, __pyx_L1_error)
3312  }
3313  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3314  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
3315  if (unlikely(!__pyx_t_10 || !__pyx_t_8 || !PyBytes_AsString(__pyx_t_10))) __PYX_ERR(0, 28, __pyx_L1_error)
3316  __Pyx_GOTREF(__pyx_t_10);
3317  __Pyx_GOTREF(__pyx_t_8);
3318  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3319  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 28, __pyx_L1_error)
3320  __Pyx_GOTREF(__pyx_t_7);
3321  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3322  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3323  __pyx_t_10 = NULL;
3324  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
3325  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
3326  if (likely(__pyx_t_10)) {
3327  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
3328  __Pyx_INCREF(__pyx_t_10);
3329  __Pyx_INCREF(function);
3330  __Pyx_DECREF_SET(__pyx_t_9, function);
3331  }
3332  }
3333  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
3334  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3335  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3336  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
3337  __Pyx_GOTREF(__pyx_t_2);
3338  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3339 
3340  /* "cpartitioning.pyx":29
3341  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3342  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3343  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3344  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3345  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3346  */
3347  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 29, __pyx_L1_error)
3348  __Pyx_GOTREF(__pyx_t_10);
3349  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
3350  __Pyx_GOTREF(__pyx_t_8);
3351  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3352  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
3353  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 29, __pyx_L1_error)
3354  __Pyx_GOTREF(__pyx_t_10);
3355  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 29, __pyx_L1_error)
3356  __Pyx_GOTREF(__pyx_t_11);
3357  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3358  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L1_error)
3359  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3360  if (!__pyx_t_4) {
3361  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3362  __PYX_ERR(0, 29, __pyx_L1_error)
3363  }
3364  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3365  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3366  if (unlikely(!__pyx_t_10 || !__pyx_t_11 || !PyBytes_AsString(__pyx_t_10))) __PYX_ERR(0, 29, __pyx_L1_error)
3367  __Pyx_GOTREF(__pyx_t_10);
3368  __Pyx_GOTREF(__pyx_t_11);
3369  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3370  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error)
3371  __Pyx_GOTREF(__pyx_t_7);
3372  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3373  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3374  __pyx_t_10 = NULL;
3375  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
3376  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
3377  if (likely(__pyx_t_10)) {
3378  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
3379  __Pyx_INCREF(__pyx_t_10);
3380  __Pyx_INCREF(function);
3381  __Pyx_DECREF_SET(__pyx_t_8, function);
3382  }
3383  }
3384  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
3385  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3386  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3387  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 29, __pyx_L1_error)
3388  __Pyx_GOTREF(__pyx_t_9);
3389  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3390 
3391  /* "cpartitioning.pyx":30
3392  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3393  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3394  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
3395  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3396  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3397  */
3398  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3399  __Pyx_GOTREF(__pyx_t_10);
3400  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 30, __pyx_L1_error)
3401  __Pyx_GOTREF(__pyx_t_11);
3402  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3403  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
3404  if (!__pyx_t_4) {
3405  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3406  __PYX_ERR(0, 30, __pyx_L1_error)
3407  }
3408  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3409  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
3410  if (unlikely(!__pyx_t_12 || !__pyx_t_10 || !PyBytes_AsString(__pyx_t_12))) __PYX_ERR(0, 30, __pyx_L1_error)
3411  __Pyx_GOTREF(__pyx_t_12);
3412  __Pyx_GOTREF(__pyx_t_10);
3413  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
3414  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 30, __pyx_L1_error)
3415  __Pyx_GOTREF(__pyx_t_7);
3416  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3417  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3418  __pyx_t_12 = NULL;
3419  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
3420  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
3421  if (likely(__pyx_t_12)) {
3422  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
3423  __Pyx_INCREF(__pyx_t_12);
3424  __Pyx_INCREF(function);
3425  __Pyx_DECREF_SET(__pyx_t_11, function);
3426  }
3427  }
3428  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
3429  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3430  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3431  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 30, __pyx_L1_error)
3432  __Pyx_GOTREF(__pyx_t_8);
3433  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3434 
3435  /* "cpartitioning.pyx":31
3436  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3437  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3438  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3439  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3440  * )
3441  */
3442  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 31, __pyx_L1_error)
3443  __Pyx_GOTREF(__pyx_t_12);
3444  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 31, __pyx_L1_error)
3445  __Pyx_GOTREF(__pyx_t_10);
3446  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3447  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
3448  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 31, __pyx_L1_error)
3449  __Pyx_GOTREF(__pyx_t_12);
3450  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 31, __pyx_L1_error)
3451  __Pyx_GOTREF(__pyx_t_13);
3452  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3453  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
3454  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3455  if (!__pyx_t_4) {
3456  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3457  __PYX_ERR(0, 31, __pyx_L1_error)
3458  }
3459  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3460  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3461  if (unlikely(!__pyx_t_12 || !__pyx_t_13 || !PyBytes_AsString(__pyx_t_12))) __PYX_ERR(0, 31, __pyx_L1_error)
3462  __Pyx_GOTREF(__pyx_t_12);
3463  __Pyx_GOTREF(__pyx_t_13);
3464  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
3465  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 31, __pyx_L1_error)
3466  __Pyx_GOTREF(__pyx_t_7);
3467  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3468  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3469  __pyx_t_12 = NULL;
3470  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
3471  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
3472  if (likely(__pyx_t_12)) {
3473  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
3474  __Pyx_INCREF(__pyx_t_12);
3475  __Pyx_INCREF(function);
3476  __Pyx_DECREF_SET(__pyx_t_10, function);
3477  }
3478  }
3479  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
3480  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3481  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3482  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 31, __pyx_L1_error)
3483  __Pyx_GOTREF(__pyx_t_11);
3484  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3485 
3486  /* "cpartitioning.pyx":32
3487  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3488  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3489  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
3490  * )
3491  *
3492  */
3493  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3494  __Pyx_GOTREF(__pyx_t_12);
3495  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 32, __pyx_L1_error)
3496  __Pyx_GOTREF(__pyx_t_13);
3497  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3498  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
3499  if (!__pyx_t_4) {
3500  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3501  __PYX_ERR(0, 32, __pyx_L1_error)
3502  }
3503  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3504  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
3505  if (unlikely(!__pyx_t_14 || !__pyx_t_12 || !PyBytes_AsString(__pyx_t_14))) __PYX_ERR(0, 32, __pyx_L1_error)
3506  __Pyx_GOTREF(__pyx_t_14);
3507  __Pyx_GOTREF(__pyx_t_12);
3508  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
3509  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error)
3510  __Pyx_GOTREF(__pyx_t_7);
3511  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3512  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3513  __pyx_t_14 = NULL;
3514  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
3515  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
3516  if (likely(__pyx_t_14)) {
3517  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
3518  __Pyx_INCREF(__pyx_t_14);
3519  __Pyx_INCREF(function);
3520  __Pyx_DECREF_SET(__pyx_t_13, function);
3521  }
3522  }
3523  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
3524  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3525  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3526  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 32, __pyx_L1_error)
3527  __Pyx_GOTREF(__pyx_t_10);
3528  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3529 
3530  /* "cpartitioning.pyx":25
3531  * nLayersOfOverlap)
3532  * return (
3533  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3534  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3535  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3536  */
3537  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 25, __pyx_L1_error)
3538  __Pyx_GOTREF(__pyx_t_13);
3539  __Pyx_GIVEREF(__pyx_t_1);
3540  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
3541  __Pyx_GIVEREF(__pyx_t_3);
3542  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
3543  __Pyx_GIVEREF(__pyx_t_5);
3544  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
3545  __Pyx_GIVEREF(__pyx_t_2);
3546  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
3547  __Pyx_GIVEREF(__pyx_t_9);
3548  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
3549  __Pyx_GIVEREF(__pyx_t_8);
3550  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
3551  __Pyx_GIVEREF(__pyx_t_11);
3552  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
3553  __Pyx_GIVEREF(__pyx_t_10);
3554  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
3555  __pyx_t_1 = 0;
3556  __pyx_t_3 = 0;
3557  __pyx_t_5 = 0;
3558  __pyx_t_2 = 0;
3559  __pyx_t_9 = 0;
3560  __pyx_t_8 = 0;
3561  __pyx_t_11 = 0;
3562  __pyx_t_10 = 0;
3563  __pyx_r = __pyx_t_13;
3564  __pyx_t_13 = 0;
3565  goto __pyx_L0;
3566 
3567  /* "cpartitioning.pyx":19
3568  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
3569  *
3570  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3571  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3572  * c_partitionElements(comm.ob_mpi,
3573  */
3574 
3575  /* function exit code */
3576  __pyx_L1_error:;
3577  __Pyx_XDECREF(__pyx_t_1);
3578  __Pyx_XDECREF(__pyx_t_2);
3579  __Pyx_XDECREF(__pyx_t_3);
3580  __Pyx_XDECREF(__pyx_t_5);
3581  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
3582  __Pyx_XDECREF(__pyx_t_8);
3583  __Pyx_XDECREF(__pyx_t_9);
3584  __Pyx_XDECREF(__pyx_t_10);
3585  __Pyx_XDECREF(__pyx_t_11);
3586  __Pyx_XDECREF(__pyx_t_12);
3587  __Pyx_XDECREF(__pyx_t_13);
3588  __Pyx_XDECREF(__pyx_t_14);
3589  __Pyx_AddTraceback("cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3590  __pyx_r = NULL;
3591  __pyx_L0:;
3592  __Pyx_XGIVEREF(__pyx_r);
3593  __Pyx_RefNannyFinishContext();
3594  return __pyx_r;
3595 }
3596 
3597 /* "cpartitioning.pyx":35
3598  * )
3599  *
3600  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3601  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3602  * c_partitionNodes(comm.ob_mpi,
3603  */
3604 
3605 /* Python wrapper */
3606 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3607 static PyMethodDef __pyx_mdef_13cpartitioning_3partitionNodes = {"partitionNodes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_3partitionNodes, METH_VARARGS|METH_KEYWORDS, 0};
3608 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3609  struct PyMPICommObject *__pyx_v_comm = 0;
3610  int __pyx_v_nLayersOfOverlap;
3611  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3612  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3613  PyObject *__pyx_r = 0;
3614  __Pyx_RefNannyDeclarations
3615  __Pyx_RefNannySetupContext("partitionNodes (wrapper)", 0);
3616  {
3617  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3618  PyObject* values[4] = {0,0,0,0};
3619  if (unlikely(__pyx_kwds)) {
3620  Py_ssize_t kw_args;
3621  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3622  switch (pos_args) {
3623  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3624  CYTHON_FALLTHROUGH;
3625  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3626  CYTHON_FALLTHROUGH;
3627  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3628  CYTHON_FALLTHROUGH;
3629  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3630  CYTHON_FALLTHROUGH;
3631  case 0: break;
3632  default: goto __pyx_L5_argtuple_error;
3633  }
3634  kw_args = PyDict_Size(__pyx_kwds);
3635  switch (pos_args) {
3636  case 0:
3637  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3638  else goto __pyx_L5_argtuple_error;
3639  CYTHON_FALLTHROUGH;
3640  case 1:
3641  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3642  else {
3643  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 1); __PYX_ERR(0, 35, __pyx_L3_error)
3644  }
3645  CYTHON_FALLTHROUGH;
3646  case 2:
3647  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3648  else {
3649  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 2); __PYX_ERR(0, 35, __pyx_L3_error)
3650  }
3651  CYTHON_FALLTHROUGH;
3652  case 3:
3653  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3654  else {
3655  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 3); __PYX_ERR(0, 35, __pyx_L3_error)
3656  }
3657  }
3658  if (unlikely(kw_args > 0)) {
3659  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionNodes") < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
3660  }
3661  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3662  goto __pyx_L5_argtuple_error;
3663  } else {
3664  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3665  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3666  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3667  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3668  }
3669  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
3670  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error)
3671  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3672  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3673  }
3674  goto __pyx_L4_argument_unpacking_done;
3675  __pyx_L5_argtuple_error:;
3676  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 35, __pyx_L3_error)
3677  __pyx_L3_error:;
3678  __Pyx_AddTraceback("cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
3679  __Pyx_RefNannyFinishContext();
3680  return NULL;
3681  __pyx_L4_argument_unpacking_done:;
3682  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 35, __pyx_L1_error)
3683  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 35, __pyx_L1_error)
3684  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 35, __pyx_L1_error)
3685  __pyx_r = __pyx_pf_13cpartitioning_2partitionNodes(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3686 
3687  /* function exit code */
3688  goto __pyx_L0;
3689  __pyx_L1_error:;
3690  __pyx_r = NULL;
3691  __pyx_L0:;
3692  __Pyx_RefNannyFinishContext();
3693  return __pyx_r;
3694 }
3695 
3696 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3697  PyObject *__pyx_r = NULL;
3698  __Pyx_RefNannyDeclarations
3699  PyObject *__pyx_t_1 = NULL;
3700  PyObject *__pyx_t_2 = NULL;
3701  PyObject *__pyx_t_3 = NULL;
3702  int *__pyx_t_4;
3703  PyObject *__pyx_t_5 = NULL;
3704  Py_ssize_t __pyx_t_6;
3705  struct __pyx_array_obj *__pyx_t_7 = NULL;
3706  PyObject *__pyx_t_8 = NULL;
3707  PyObject *__pyx_t_9 = NULL;
3708  PyObject *__pyx_t_10 = NULL;
3709  PyObject *__pyx_t_11 = NULL;
3710  PyObject *__pyx_t_12 = NULL;
3711  PyObject *__pyx_t_13 = NULL;
3712  PyObject *__pyx_t_14 = NULL;
3713  __Pyx_RefNannySetupContext("partitionNodes", 0);
3714 
3715  /* "cpartitioning.pyx":36
3716  *
3717  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3718  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
3719  * c_partitionNodes(comm.ob_mpi,
3720  * cmesh.mesh,
3721  */
3722  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3723 
3724  /* "cpartitioning.pyx":37
3725  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3726  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3727  * c_partitionNodes(comm.ob_mpi, # <<<<<<<<<<<<<<
3728  * cmesh.mesh,
3729  * nLayersOfOverlap)
3730  */
3731  (void)(proteus::partitionNodes(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
3732 
3733  /* "cpartitioning.pyx":40
3734  * cmesh.mesh,
3735  * nLayersOfOverlap)
3736  * return ( # <<<<<<<<<<<<<<
3737  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3738  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3739  */
3740  __Pyx_XDECREF(__pyx_r);
3741 
3742  /* "cpartitioning.pyx":41
3743  * nLayersOfOverlap)
3744  * return (
3745  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3746  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3747  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3748  */
3749  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
3750  __Pyx_GOTREF(__pyx_t_2);
3751  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
3752  __Pyx_GOTREF(__pyx_t_3);
3753  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3754  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3755  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
3756  __Pyx_GOTREF(__pyx_t_2);
3757  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error)
3758  __Pyx_GOTREF(__pyx_t_5);
3759  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3760  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L1_error)
3761  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3762  if (!__pyx_t_4) {
3763  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3764  __PYX_ERR(0, 41, __pyx_L1_error)
3765  }
3766  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3767  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3768  if (unlikely(!__pyx_t_2 || !__pyx_t_5 || !PyBytes_AsString(__pyx_t_2))) __PYX_ERR(0, 41, __pyx_L1_error)
3769  __Pyx_GOTREF(__pyx_t_2);
3770  __Pyx_GOTREF(__pyx_t_5);
3771  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
3772  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error)
3773  __Pyx_GOTREF(__pyx_t_7);
3774  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3775  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3776  __pyx_t_2 = NULL;
3777  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3778  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3779  if (likely(__pyx_t_2)) {
3780  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3781  __Pyx_INCREF(__pyx_t_2);
3782  __Pyx_INCREF(function);
3783  __Pyx_DECREF_SET(__pyx_t_3, function);
3784  }
3785  }
3786  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3787  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3788  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3789  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
3790  __Pyx_GOTREF(__pyx_t_1);
3791  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3792 
3793  /* "cpartitioning.pyx":42
3794  * return (
3795  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3796  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
3797  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3798  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3799  */
3800  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3801  __Pyx_GOTREF(__pyx_t_2);
3802  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
3803  __Pyx_GOTREF(__pyx_t_5);
3804  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3805  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3806  if (!__pyx_t_4) {
3807  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3808  __PYX_ERR(0, 42, __pyx_L1_error)
3809  }
3810  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3811  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
3812  if (unlikely(!__pyx_t_8 || !__pyx_t_2 || !PyBytes_AsString(__pyx_t_8))) __PYX_ERR(0, 42, __pyx_L1_error)
3813  __Pyx_GOTREF(__pyx_t_8);
3814  __Pyx_GOTREF(__pyx_t_2);
3815  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3816  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
3817  __Pyx_GOTREF(__pyx_t_7);
3818  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3819  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3820  __pyx_t_8 = NULL;
3821  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3822  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3823  if (likely(__pyx_t_8)) {
3824  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3825  __Pyx_INCREF(__pyx_t_8);
3826  __Pyx_INCREF(function);
3827  __Pyx_DECREF_SET(__pyx_t_5, function);
3828  }
3829  }
3830  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3831  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3832  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3833  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
3834  __Pyx_GOTREF(__pyx_t_3);
3835  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3836 
3837  /* "cpartitioning.pyx":43
3838  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3839  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3840  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3841  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3842  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3843  */
3844  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error)
3845  __Pyx_GOTREF(__pyx_t_8);
3846  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3847  __Pyx_GOTREF(__pyx_t_2);
3848  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3849  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3850  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error)
3851  __Pyx_GOTREF(__pyx_t_8);
3852  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L1_error)
3853  __Pyx_GOTREF(__pyx_t_9);
3854  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3855  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L1_error)
3856  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3857  if (!__pyx_t_4) {
3858  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3859  __PYX_ERR(0, 43, __pyx_L1_error)
3860  }
3861  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3862  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3863  if (unlikely(!__pyx_t_8 || !__pyx_t_9 || !PyBytes_AsString(__pyx_t_8))) __PYX_ERR(0, 43, __pyx_L1_error)
3864  __Pyx_GOTREF(__pyx_t_8);
3865  __Pyx_GOTREF(__pyx_t_9);
3866  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3867  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
3868  __Pyx_GOTREF(__pyx_t_7);
3869  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3870  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3871  __pyx_t_8 = NULL;
3872  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3873  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3874  if (likely(__pyx_t_8)) {
3875  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3876  __Pyx_INCREF(__pyx_t_8);
3877  __Pyx_INCREF(function);
3878  __Pyx_DECREF_SET(__pyx_t_2, function);
3879  }
3880  }
3881  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
3882  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3883  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3884  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error)
3885  __Pyx_GOTREF(__pyx_t_5);
3886  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3887 
3888  /* "cpartitioning.pyx":44
3889  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3890  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3891  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
3892  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3893  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3894  */
3895  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3896  __Pyx_GOTREF(__pyx_t_8);
3897  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error)
3898  __Pyx_GOTREF(__pyx_t_9);
3899  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3900  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
3901  if (!__pyx_t_4) {
3902  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3903  __PYX_ERR(0, 44, __pyx_L1_error)
3904  }
3905  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3906  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
3907  if (unlikely(!__pyx_t_10 || !__pyx_t_8 || !PyBytes_AsString(__pyx_t_10))) __PYX_ERR(0, 44, __pyx_L1_error)
3908  __Pyx_GOTREF(__pyx_t_10);
3909  __Pyx_GOTREF(__pyx_t_8);
3910  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3911  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L1_error)
3912  __Pyx_GOTREF(__pyx_t_7);
3913  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3914  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3915  __pyx_t_10 = NULL;
3916  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
3917  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
3918  if (likely(__pyx_t_10)) {
3919  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
3920  __Pyx_INCREF(__pyx_t_10);
3921  __Pyx_INCREF(function);
3922  __Pyx_DECREF_SET(__pyx_t_9, function);
3923  }
3924  }
3925  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
3926  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3927  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3928  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
3929  __Pyx_GOTREF(__pyx_t_2);
3930  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3931 
3932  /* "cpartitioning.pyx":45
3933  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3934  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3935  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3936  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3937  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
3938  */
3939  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 45, __pyx_L1_error)
3940  __Pyx_GOTREF(__pyx_t_10);
3941  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error)
3942  __Pyx_GOTREF(__pyx_t_8);
3943  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3944  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
3945  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 45, __pyx_L1_error)
3946  __Pyx_GOTREF(__pyx_t_10);
3947  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 45, __pyx_L1_error)
3948  __Pyx_GOTREF(__pyx_t_11);
3949  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3950  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
3951  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3952  if (!__pyx_t_4) {
3953  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3954  __PYX_ERR(0, 45, __pyx_L1_error)
3955  }
3956  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3957  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3958  if (unlikely(!__pyx_t_10 || !__pyx_t_11 || !PyBytes_AsString(__pyx_t_10))) __PYX_ERR(0, 45, __pyx_L1_error)
3959  __Pyx_GOTREF(__pyx_t_10);
3960  __Pyx_GOTREF(__pyx_t_11);
3961  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3962  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
3963  __Pyx_GOTREF(__pyx_t_7);
3964  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3965  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3966  __pyx_t_10 = NULL;
3967  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
3968  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
3969  if (likely(__pyx_t_10)) {
3970  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
3971  __Pyx_INCREF(__pyx_t_10);
3972  __Pyx_INCREF(function);
3973  __Pyx_DECREF_SET(__pyx_t_8, function);
3974  }
3975  }
3976  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
3977  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3978  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3979  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error)
3980  __Pyx_GOTREF(__pyx_t_9);
3981  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3982 
3983  /* "cpartitioning.pyx":46
3984  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3985  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3986  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
3987  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
3988  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3989  */
3990  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
3991  __Pyx_GOTREF(__pyx_t_10);
3992  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error)
3993  __Pyx_GOTREF(__pyx_t_11);
3994  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3995  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
3996  if (!__pyx_t_4) {
3997  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3998  __PYX_ERR(0, 46, __pyx_L1_error)
3999  }
4000  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4001  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
4002  if (unlikely(!__pyx_t_12 || !__pyx_t_10 || !PyBytes_AsString(__pyx_t_12))) __PYX_ERR(0, 46, __pyx_L1_error)
4003  __Pyx_GOTREF(__pyx_t_12);
4004  __Pyx_GOTREF(__pyx_t_10);
4005  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4006  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error)
4007  __Pyx_GOTREF(__pyx_t_7);
4008  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4009  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4010  __pyx_t_12 = NULL;
4011  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4012  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4013  if (likely(__pyx_t_12)) {
4014  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
4015  __Pyx_INCREF(__pyx_t_12);
4016  __Pyx_INCREF(function);
4017  __Pyx_DECREF_SET(__pyx_t_11, function);
4018  }
4019  }
4020  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4021  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4022  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4023  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error)
4024  __Pyx_GOTREF(__pyx_t_8);
4025  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4026 
4027  /* "cpartitioning.pyx":47
4028  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4029  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4030  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4031  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4032  * )
4033  */
4034  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error)
4035  __Pyx_GOTREF(__pyx_t_12);
4036  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 47, __pyx_L1_error)
4037  __Pyx_GOTREF(__pyx_t_10);
4038  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4039  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4040  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error)
4041  __Pyx_GOTREF(__pyx_t_12);
4042  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 47, __pyx_L1_error)
4043  __Pyx_GOTREF(__pyx_t_13);
4044  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4045  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error)
4046  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4047  if (!__pyx_t_4) {
4048  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4049  __PYX_ERR(0, 47, __pyx_L1_error)
4050  }
4051  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4052  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
4053  if (unlikely(!__pyx_t_12 || !__pyx_t_13 || !PyBytes_AsString(__pyx_t_12))) __PYX_ERR(0, 47, __pyx_L1_error)
4054  __Pyx_GOTREF(__pyx_t_12);
4055  __Pyx_GOTREF(__pyx_t_13);
4056  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4057  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error)
4058  __Pyx_GOTREF(__pyx_t_7);
4059  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4060  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4061  __pyx_t_12 = NULL;
4062  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4063  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4064  if (likely(__pyx_t_12)) {
4065  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
4066  __Pyx_INCREF(__pyx_t_12);
4067  __Pyx_INCREF(function);
4068  __Pyx_DECREF_SET(__pyx_t_10, function);
4069  }
4070  }
4071  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4072  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4073  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4074  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 47, __pyx_L1_error)
4075  __Pyx_GOTREF(__pyx_t_11);
4076  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4077 
4078  /* "cpartitioning.pyx":48
4079  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4080  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4081  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
4082  * )
4083  *
4084  */
4085  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4086  __Pyx_GOTREF(__pyx_t_12);
4087  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error)
4088  __Pyx_GOTREF(__pyx_t_13);
4089  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4090  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4091  if (!__pyx_t_4) {
4092  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4093  __PYX_ERR(0, 48, __pyx_L1_error)
4094  }
4095  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4096  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
4097  if (unlikely(!__pyx_t_14 || !__pyx_t_12 || !PyBytes_AsString(__pyx_t_14))) __PYX_ERR(0, 48, __pyx_L1_error)
4098  __Pyx_GOTREF(__pyx_t_14);
4099  __Pyx_GOTREF(__pyx_t_12);
4100  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
4101  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error)
4102  __Pyx_GOTREF(__pyx_t_7);
4103  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4104  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4105  __pyx_t_14 = NULL;
4106  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4107  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4108  if (likely(__pyx_t_14)) {
4109  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
4110  __Pyx_INCREF(__pyx_t_14);
4111  __Pyx_INCREF(function);
4112  __Pyx_DECREF_SET(__pyx_t_13, function);
4113  }
4114  }
4115  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4116  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4117  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4118  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 48, __pyx_L1_error)
4119  __Pyx_GOTREF(__pyx_t_10);
4120  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4121 
4122  /* "cpartitioning.pyx":41
4123  * nLayersOfOverlap)
4124  * return (
4125  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4126  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4127  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4128  */
4129  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 41, __pyx_L1_error)
4130  __Pyx_GOTREF(__pyx_t_13);
4131  __Pyx_GIVEREF(__pyx_t_1);
4132  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4133  __Pyx_GIVEREF(__pyx_t_3);
4134  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4135  __Pyx_GIVEREF(__pyx_t_5);
4136  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4137  __Pyx_GIVEREF(__pyx_t_2);
4138  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4139  __Pyx_GIVEREF(__pyx_t_9);
4140  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4141  __Pyx_GIVEREF(__pyx_t_8);
4142  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4143  __Pyx_GIVEREF(__pyx_t_11);
4144  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4145  __Pyx_GIVEREF(__pyx_t_10);
4146  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4147  __pyx_t_1 = 0;
4148  __pyx_t_3 = 0;
4149  __pyx_t_5 = 0;
4150  __pyx_t_2 = 0;
4151  __pyx_t_9 = 0;
4152  __pyx_t_8 = 0;
4153  __pyx_t_11 = 0;
4154  __pyx_t_10 = 0;
4155  __pyx_r = __pyx_t_13;
4156  __pyx_t_13 = 0;
4157  goto __pyx_L0;
4158 
4159  /* "cpartitioning.pyx":35
4160  * )
4161  *
4162  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4163  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4164  * c_partitionNodes(comm.ob_mpi,
4165  */
4166 
4167  /* function exit code */
4168  __pyx_L1_error:;
4169  __Pyx_XDECREF(__pyx_t_1);
4170  __Pyx_XDECREF(__pyx_t_2);
4171  __Pyx_XDECREF(__pyx_t_3);
4172  __Pyx_XDECREF(__pyx_t_5);
4173  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4174  __Pyx_XDECREF(__pyx_t_8);
4175  __Pyx_XDECREF(__pyx_t_9);
4176  __Pyx_XDECREF(__pyx_t_10);
4177  __Pyx_XDECREF(__pyx_t_11);
4178  __Pyx_XDECREF(__pyx_t_12);
4179  __Pyx_XDECREF(__pyx_t_13);
4180  __Pyx_XDECREF(__pyx_t_14);
4181  __Pyx_AddTraceback("cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
4182  __pyx_r = NULL;
4183  __pyx_L0:;
4184  __Pyx_XGIVEREF(__pyx_r);
4185  __Pyx_RefNannyFinishContext();
4186  return __pyx_r;
4187 }
4188 
4189 /* "cpartitioning.pyx":51
4190  * )
4191  *
4192  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4193  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4194  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4195  */
4196 
4197 /* Python wrapper */
4198 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4199 static PyMethodDef __pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython = {"convertPUMIPartitionToPython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython, METH_VARARGS|METH_KEYWORDS, 0};
4200 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4201  CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm = 0;
4202  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4203  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4204  PyObject *__pyx_r = 0;
4205  __Pyx_RefNannyDeclarations
4206  __Pyx_RefNannySetupContext("convertPUMIPartitionToPython (wrapper)", 0);
4207  {
4208  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4209  PyObject* values[3] = {0,0,0};
4210  if (unlikely(__pyx_kwds)) {
4211  Py_ssize_t kw_args;
4212  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4213  switch (pos_args) {
4214  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4215  CYTHON_FALLTHROUGH;
4216  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4217  CYTHON_FALLTHROUGH;
4218  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4219  CYTHON_FALLTHROUGH;
4220  case 0: break;
4221  default: goto __pyx_L5_argtuple_error;
4222  }
4223  kw_args = PyDict_Size(__pyx_kwds);
4224  switch (pos_args) {
4225  case 0:
4226  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4227  else goto __pyx_L5_argtuple_error;
4228  CYTHON_FALLTHROUGH;
4229  case 1:
4230  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4231  else {
4232  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, 1); __PYX_ERR(0, 51, __pyx_L3_error)
4233  }
4234  CYTHON_FALLTHROUGH;
4235  case 2:
4236  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4237  else {
4238  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, 2); __PYX_ERR(0, 51, __pyx_L3_error)
4239  }
4240  }
4241  if (unlikely(kw_args > 0)) {
4242  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convertPUMIPartitionToPython") < 0)) __PYX_ERR(0, 51, __pyx_L3_error)
4243  }
4244  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4245  goto __pyx_L5_argtuple_error;
4246  } else {
4247  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4248  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4249  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4250  }
4251  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
4252  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[1]);
4253  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
4254  }
4255  goto __pyx_L4_argument_unpacking_done;
4256  __pyx_L5_argtuple_error:;
4257  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 51, __pyx_L3_error)
4258  __pyx_L3_error:;
4259  __Pyx_AddTraceback("cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4260  __Pyx_RefNannyFinishContext();
4261  return NULL;
4262  __pyx_L4_argument_unpacking_done:;
4263  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 51, __pyx_L1_error)
4264  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 51, __pyx_L1_error)
4265  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 51, __pyx_L1_error)
4266  __pyx_r = __pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(__pyx_self, __pyx_v_comm, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4267 
4268  /* function exit code */
4269  goto __pyx_L0;
4270  __pyx_L1_error:;
4271  __pyx_r = NULL;
4272  __pyx_L0:;
4273  __Pyx_RefNannyFinishContext();
4274  return __pyx_r;
4275 }
4276 
4277 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4278  PyObject *__pyx_r = NULL;
4279  __Pyx_RefNannyDeclarations
4280  PyObject *__pyx_t_1 = NULL;
4281  PyObject *__pyx_t_2 = NULL;
4282  PyObject *__pyx_t_3 = NULL;
4283  int *__pyx_t_4;
4284  PyObject *__pyx_t_5 = NULL;
4285  Py_ssize_t __pyx_t_6;
4286  struct __pyx_array_obj *__pyx_t_7 = NULL;
4287  PyObject *__pyx_t_8 = NULL;
4288  PyObject *__pyx_t_9 = NULL;
4289  PyObject *__pyx_t_10 = NULL;
4290  PyObject *__pyx_t_11 = NULL;
4291  PyObject *__pyx_t_12 = NULL;
4292  PyObject *__pyx_t_13 = NULL;
4293  PyObject *__pyx_t_14 = NULL;
4294  __Pyx_RefNannySetupContext("convertPUMIPartitionToPython", 0);
4295 
4296  /* "cpartitioning.pyx":53
4297  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4298  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4299  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
4300  * return (
4301  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4302  */
4303  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
4304 
4305  /* "cpartitioning.pyx":54
4306  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4307  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4308  * return ( # <<<<<<<<<<<<<<
4309  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4310  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4311  */
4312  __Pyx_XDECREF(__pyx_r);
4313 
4314  /* "cpartitioning.pyx":55
4315  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4316  * return (
4317  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4318  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4319  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4320  */
4321  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
4322  __Pyx_GOTREF(__pyx_t_2);
4323  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
4324  __Pyx_GOTREF(__pyx_t_3);
4325  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4326  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
4327  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
4328  __Pyx_GOTREF(__pyx_t_2);
4329  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error)
4330  __Pyx_GOTREF(__pyx_t_5);
4331  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4332  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error)
4333  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4334  if (!__pyx_t_4) {
4335  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4336  __PYX_ERR(0, 55, __pyx_L1_error)
4337  }
4338  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4339  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
4340  if (unlikely(!__pyx_t_2 || !__pyx_t_5 || !PyBytes_AsString(__pyx_t_2))) __PYX_ERR(0, 55, __pyx_L1_error)
4341  __Pyx_GOTREF(__pyx_t_2);
4342  __Pyx_GOTREF(__pyx_t_5);
4343  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
4344  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error)
4345  __Pyx_GOTREF(__pyx_t_7);
4346  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4347  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4348  __pyx_t_2 = NULL;
4349  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4350  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4351  if (likely(__pyx_t_2)) {
4352  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4353  __Pyx_INCREF(__pyx_t_2);
4354  __Pyx_INCREF(function);
4355  __Pyx_DECREF_SET(__pyx_t_3, function);
4356  }
4357  }
4358  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
4359  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4360  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4361  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
4362  __Pyx_GOTREF(__pyx_t_1);
4363  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4364 
4365  /* "cpartitioning.pyx":56
4366  * return (
4367  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4368  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
4369  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4370  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4371  */
4372  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4373  __Pyx_GOTREF(__pyx_t_2);
4374  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
4375  __Pyx_GOTREF(__pyx_t_5);
4376  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4377  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
4378  if (!__pyx_t_4) {
4379  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4380  __PYX_ERR(0, 56, __pyx_L1_error)
4381  }
4382  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4383  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
4384  if (unlikely(!__pyx_t_8 || !__pyx_t_2 || !PyBytes_AsString(__pyx_t_8))) __PYX_ERR(0, 56, __pyx_L1_error)
4385  __Pyx_GOTREF(__pyx_t_8);
4386  __Pyx_GOTREF(__pyx_t_2);
4387  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
4388  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L1_error)
4389  __Pyx_GOTREF(__pyx_t_7);
4390  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4391  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4392  __pyx_t_8 = NULL;
4393  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4394  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
4395  if (likely(__pyx_t_8)) {
4396  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
4397  __Pyx_INCREF(__pyx_t_8);
4398  __Pyx_INCREF(function);
4399  __Pyx_DECREF_SET(__pyx_t_5, function);
4400  }
4401  }
4402  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
4403  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4404  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4405  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
4406  __Pyx_GOTREF(__pyx_t_3);
4407  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4408 
4409  /* "cpartitioning.pyx":57
4410  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4411  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4412  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4413  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4414  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4415  */
4416  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L1_error)
4417  __Pyx_GOTREF(__pyx_t_8);
4418  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
4419  __Pyx_GOTREF(__pyx_t_2);
4420  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4421  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
4422  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L1_error)
4423  __Pyx_GOTREF(__pyx_t_8);
4424  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L1_error)
4425  __Pyx_GOTREF(__pyx_t_9);
4426  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4427  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
4428  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4429  if (!__pyx_t_4) {
4430  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4431  __PYX_ERR(0, 57, __pyx_L1_error)
4432  }
4433  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4434  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
4435  if (unlikely(!__pyx_t_8 || !__pyx_t_9 || !PyBytes_AsString(__pyx_t_8))) __PYX_ERR(0, 57, __pyx_L1_error)
4436  __Pyx_GOTREF(__pyx_t_8);
4437  __Pyx_GOTREF(__pyx_t_9);
4438  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
4439  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error)
4440  __Pyx_GOTREF(__pyx_t_7);
4441  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4442  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4443  __pyx_t_8 = NULL;
4444  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4445  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
4446  if (likely(__pyx_t_8)) {
4447  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4448  __Pyx_INCREF(__pyx_t_8);
4449  __Pyx_INCREF(function);
4450  __Pyx_DECREF_SET(__pyx_t_2, function);
4451  }
4452  }
4453  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
4454  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4455  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4456  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
4457  __Pyx_GOTREF(__pyx_t_5);
4458  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4459 
4460  /* "cpartitioning.pyx":58
4461  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4462  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4463  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
4464  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4465  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4466  */
4467  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4468  __Pyx_GOTREF(__pyx_t_8);
4469  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 58, __pyx_L1_error)
4470  __Pyx_GOTREF(__pyx_t_9);
4471  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4472  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
4473  if (!__pyx_t_4) {
4474  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4475  __PYX_ERR(0, 58, __pyx_L1_error)
4476  }
4477  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4478  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
4479  if (unlikely(!__pyx_t_10 || !__pyx_t_8 || !PyBytes_AsString(__pyx_t_10))) __PYX_ERR(0, 58, __pyx_L1_error)
4480  __Pyx_GOTREF(__pyx_t_10);
4481  __Pyx_GOTREF(__pyx_t_8);
4482  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
4483  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __pyx_L1_error)
4484  __Pyx_GOTREF(__pyx_t_7);
4485  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4486  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4487  __pyx_t_10 = NULL;
4488  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
4489  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
4490  if (likely(__pyx_t_10)) {
4491  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
4492  __Pyx_INCREF(__pyx_t_10);
4493  __Pyx_INCREF(function);
4494  __Pyx_DECREF_SET(__pyx_t_9, function);
4495  }
4496  }
4497  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
4498  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4499  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4500  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
4501  __Pyx_GOTREF(__pyx_t_2);
4502  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4503 
4504  /* "cpartitioning.pyx":59
4505  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4506  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4507  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4508  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4509  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4510  */
4511  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error)
4512  __Pyx_GOTREF(__pyx_t_10);
4513  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error)
4514  __Pyx_GOTREF(__pyx_t_8);
4515  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4516  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
4517  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error)
4518  __Pyx_GOTREF(__pyx_t_10);
4519  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L1_error)
4520  __Pyx_GOTREF(__pyx_t_11);
4521  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4522  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error)
4523  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4524  if (!__pyx_t_4) {
4525  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4526  __PYX_ERR(0, 59, __pyx_L1_error)
4527  }
4528  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4529  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
4530  if (unlikely(!__pyx_t_10 || !__pyx_t_11 || !PyBytes_AsString(__pyx_t_10))) __PYX_ERR(0, 59, __pyx_L1_error)
4531  __Pyx_GOTREF(__pyx_t_10);
4532  __Pyx_GOTREF(__pyx_t_11);
4533  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
4534  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error)
4535  __Pyx_GOTREF(__pyx_t_7);
4536  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4537  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4538  __pyx_t_10 = NULL;
4539  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
4540  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
4541  if (likely(__pyx_t_10)) {
4542  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
4543  __Pyx_INCREF(__pyx_t_10);
4544  __Pyx_INCREF(function);
4545  __Pyx_DECREF_SET(__pyx_t_8, function);
4546  }
4547  }
4548  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
4549  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4550  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4551  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 59, __pyx_L1_error)
4552  __Pyx_GOTREF(__pyx_t_9);
4553  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4554 
4555  /* "cpartitioning.pyx":60
4556  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4557  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4558  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
4559  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4560  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4561  */
4562  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4563  __Pyx_GOTREF(__pyx_t_10);
4564  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
4565  __Pyx_GOTREF(__pyx_t_11);
4566  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4567  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
4568  if (!__pyx_t_4) {
4569  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4570  __PYX_ERR(0, 60, __pyx_L1_error)
4571  }
4572  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4573  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
4574  if (unlikely(!__pyx_t_12 || !__pyx_t_10 || !PyBytes_AsString(__pyx_t_12))) __PYX_ERR(0, 60, __pyx_L1_error)
4575  __Pyx_GOTREF(__pyx_t_12);
4576  __Pyx_GOTREF(__pyx_t_10);
4577  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4578  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error)
4579  __Pyx_GOTREF(__pyx_t_7);
4580  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4581  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4582  __pyx_t_12 = NULL;
4583  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4584  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4585  if (likely(__pyx_t_12)) {
4586  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
4587  __Pyx_INCREF(__pyx_t_12);
4588  __Pyx_INCREF(function);
4589  __Pyx_DECREF_SET(__pyx_t_11, function);
4590  }
4591  }
4592  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4593  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4594  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4595  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error)
4596  __Pyx_GOTREF(__pyx_t_8);
4597  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4598 
4599  /* "cpartitioning.pyx":61
4600  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4601  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4602  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4603  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4604  * )
4605  */
4606  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 61, __pyx_L1_error)
4607  __Pyx_GOTREF(__pyx_t_12);
4608  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
4609  __Pyx_GOTREF(__pyx_t_10);
4610  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4611  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4612  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 61, __pyx_L1_error)
4613  __Pyx_GOTREF(__pyx_t_12);
4614  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 61, __pyx_L1_error)
4615  __Pyx_GOTREF(__pyx_t_13);
4616  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4617  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
4618  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4619  if (!__pyx_t_4) {
4620  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4621  __PYX_ERR(0, 61, __pyx_L1_error)
4622  }
4623  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4624  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
4625  if (unlikely(!__pyx_t_12 || !__pyx_t_13 || !PyBytes_AsString(__pyx_t_12))) __PYX_ERR(0, 61, __pyx_L1_error)
4626  __Pyx_GOTREF(__pyx_t_12);
4627  __Pyx_GOTREF(__pyx_t_13);
4628  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4629  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error)
4630  __Pyx_GOTREF(__pyx_t_7);
4631  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4632  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4633  __pyx_t_12 = NULL;
4634  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4635  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4636  if (likely(__pyx_t_12)) {
4637  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
4638  __Pyx_INCREF(__pyx_t_12);
4639  __Pyx_INCREF(function);
4640  __Pyx_DECREF_SET(__pyx_t_10, function);
4641  }
4642  }
4643  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4644  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4645  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4646  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 61, __pyx_L1_error)
4647  __Pyx_GOTREF(__pyx_t_11);
4648  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4649 
4650  /* "cpartitioning.pyx":62
4651  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4652  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4653  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
4654  * )
4655  *
4656  */
4657  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4658  __Pyx_GOTREF(__pyx_t_12);
4659  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
4660  __Pyx_GOTREF(__pyx_t_13);
4661  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4662  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4663  if (!__pyx_t_4) {
4664  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4665  __PYX_ERR(0, 62, __pyx_L1_error)
4666  }
4667  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4668  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
4669  if (unlikely(!__pyx_t_14 || !__pyx_t_12 || !PyBytes_AsString(__pyx_t_14))) __PYX_ERR(0, 62, __pyx_L1_error)
4670  __Pyx_GOTREF(__pyx_t_14);
4671  __Pyx_GOTREF(__pyx_t_12);
4672  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
4673  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 62, __pyx_L1_error)
4674  __Pyx_GOTREF(__pyx_t_7);
4675  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4676  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4677  __pyx_t_14 = NULL;
4678  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4679  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4680  if (likely(__pyx_t_14)) {
4681  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
4682  __Pyx_INCREF(__pyx_t_14);
4683  __Pyx_INCREF(function);
4684  __Pyx_DECREF_SET(__pyx_t_13, function);
4685  }
4686  }
4687  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4688  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4689  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4690  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 62, __pyx_L1_error)
4691  __Pyx_GOTREF(__pyx_t_10);
4692  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4693 
4694  /* "cpartitioning.pyx":55
4695  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4696  * return (
4697  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4698  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4699  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4700  */
4701  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 55, __pyx_L1_error)
4702  __Pyx_GOTREF(__pyx_t_13);
4703  __Pyx_GIVEREF(__pyx_t_1);
4704  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4705  __Pyx_GIVEREF(__pyx_t_3);
4706  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4707  __Pyx_GIVEREF(__pyx_t_5);
4708  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4709  __Pyx_GIVEREF(__pyx_t_2);
4710  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4711  __Pyx_GIVEREF(__pyx_t_9);
4712  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4713  __Pyx_GIVEREF(__pyx_t_8);
4714  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4715  __Pyx_GIVEREF(__pyx_t_11);
4716  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4717  __Pyx_GIVEREF(__pyx_t_10);
4718  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4719  __pyx_t_1 = 0;
4720  __pyx_t_3 = 0;
4721  __pyx_t_5 = 0;
4722  __pyx_t_2 = 0;
4723  __pyx_t_9 = 0;
4724  __pyx_t_8 = 0;
4725  __pyx_t_11 = 0;
4726  __pyx_t_10 = 0;
4727  __pyx_r = __pyx_t_13;
4728  __pyx_t_13 = 0;
4729  goto __pyx_L0;
4730 
4731  /* "cpartitioning.pyx":51
4732  * )
4733  *
4734  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4735  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4736  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4737  */
4738 
4739  /* function exit code */
4740  __pyx_L1_error:;
4741  __Pyx_XDECREF(__pyx_t_1);
4742  __Pyx_XDECREF(__pyx_t_2);
4743  __Pyx_XDECREF(__pyx_t_3);
4744  __Pyx_XDECREF(__pyx_t_5);
4745  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4746  __Pyx_XDECREF(__pyx_t_8);
4747  __Pyx_XDECREF(__pyx_t_9);
4748  __Pyx_XDECREF(__pyx_t_10);
4749  __Pyx_XDECREF(__pyx_t_11);
4750  __Pyx_XDECREF(__pyx_t_12);
4751  __Pyx_XDECREF(__pyx_t_13);
4752  __Pyx_XDECREF(__pyx_t_14);
4753  __Pyx_AddTraceback("cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4754  __pyx_r = NULL;
4755  __pyx_L0:;
4756  __Pyx_XGIVEREF(__pyx_r);
4757  __Pyx_RefNannyFinishContext();
4758  return __pyx_r;
4759 }
4760 
4761 /* "cpartitioning.pyx":65
4762  * )
4763  *
4764  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4765  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4766  * if not isinstance(filebase, bytes):
4767  */
4768 
4769 /* Python wrapper */
4770 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4771 static PyMethodDef __pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles = {"partitionNodesFromTetgenFiles", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles, METH_VARARGS|METH_KEYWORDS, 0};
4772 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4773  struct PyMPICommObject *__pyx_v_comm = 0;
4774  PyObject *__pyx_v_filebase = 0;
4775  int __pyx_v_indexBase;
4776  int __pyx_v_nLayersOfOverlap;
4777  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4778  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4779  PyObject *__pyx_r = 0;
4780  __Pyx_RefNannyDeclarations
4781  __Pyx_RefNannySetupContext("partitionNodesFromTetgenFiles (wrapper)", 0);
4782  {
4783  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_filebase,&__pyx_n_s_indexBase,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4784  PyObject* values[6] = {0,0,0,0,0,0};
4785  if (unlikely(__pyx_kwds)) {
4786  Py_ssize_t kw_args;
4787  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4788  switch (pos_args) {
4789  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4790  CYTHON_FALLTHROUGH;
4791  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4792  CYTHON_FALLTHROUGH;
4793  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4794  CYTHON_FALLTHROUGH;
4795  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4796  CYTHON_FALLTHROUGH;
4797  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4798  CYTHON_FALLTHROUGH;
4799  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4800  CYTHON_FALLTHROUGH;
4801  case 0: break;
4802  default: goto __pyx_L5_argtuple_error;
4803  }
4804  kw_args = PyDict_Size(__pyx_kwds);
4805  switch (pos_args) {
4806  case 0:
4807  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4808  else goto __pyx_L5_argtuple_error;
4809  CYTHON_FALLTHROUGH;
4810  case 1:
4811  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filebase)) != 0)) kw_args--;
4812  else {
4813  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 1); __PYX_ERR(0, 65, __pyx_L3_error)
4814  }
4815  CYTHON_FALLTHROUGH;
4816  case 2:
4817  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indexBase)) != 0)) kw_args--;
4818  else {
4819  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 2); __PYX_ERR(0, 65, __pyx_L3_error)
4820  }
4821  CYTHON_FALLTHROUGH;
4822  case 3:
4823  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
4824  else {
4825  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 3); __PYX_ERR(0, 65, __pyx_L3_error)
4826  }
4827  CYTHON_FALLTHROUGH;
4828  case 4:
4829  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4830  else {
4831  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 4); __PYX_ERR(0, 65, __pyx_L3_error)
4832  }
4833  CYTHON_FALLTHROUGH;
4834  case 5:
4835  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4836  else {
4837  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 5); __PYX_ERR(0, 65, __pyx_L3_error)
4838  }
4839  }
4840  if (unlikely(kw_args > 0)) {
4841  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionNodesFromTetgenFiles") < 0)) __PYX_ERR(0, 65, __pyx_L3_error)
4842  }
4843  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4844  goto __pyx_L5_argtuple_error;
4845  } else {
4846  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4847  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4848  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4849  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4850  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4851  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4852  }
4853  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
4854  __pyx_v_filebase = values[1];
4855  __pyx_v_indexBase = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_indexBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error)
4856  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error)
4857  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[4]);
4858  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[5]);
4859  }
4860  goto __pyx_L4_argument_unpacking_done;
4861  __pyx_L5_argtuple_error:;
4862  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 65, __pyx_L3_error)
4863  __pyx_L3_error:;
4864  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
4865  __Pyx_RefNannyFinishContext();
4866  return NULL;
4867  __pyx_L4_argument_unpacking_done:;
4868  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 65, __pyx_L1_error)
4869  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 65, __pyx_L1_error)
4870  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 65, __pyx_L1_error)
4871  __pyx_r = __pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(__pyx_self, __pyx_v_comm, __pyx_v_filebase, __pyx_v_indexBase, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4872 
4873  /* function exit code */
4874  goto __pyx_L0;
4875  __pyx_L1_error:;
4876  __pyx_r = NULL;
4877  __pyx_L0:;
4878  __Pyx_RefNannyFinishContext();
4879  return __pyx_r;
4880 }
4881 
4882 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4883  PyObject *__pyx_r = NULL;
4884  __Pyx_RefNannyDeclarations
4885  int __pyx_t_1;
4886  int __pyx_t_2;
4887  PyObject *__pyx_t_3 = NULL;
4888  PyObject *__pyx_t_4 = NULL;
4889  PyObject *__pyx_t_5 = NULL;
4890  char *__pyx_t_6;
4891  int *__pyx_t_7;
4892  PyObject *__pyx_t_8 = NULL;
4893  Py_ssize_t __pyx_t_9;
4894  struct __pyx_array_obj *__pyx_t_10 = NULL;
4895  PyObject *__pyx_t_11 = NULL;
4896  PyObject *__pyx_t_12 = NULL;
4897  PyObject *__pyx_t_13 = NULL;
4898  PyObject *__pyx_t_14 = NULL;
4899  PyObject *__pyx_t_15 = NULL;
4900  PyObject *__pyx_t_16 = NULL;
4901  PyObject *__pyx_t_17 = NULL;
4902  __Pyx_RefNannySetupContext("partitionNodesFromTetgenFiles", 0);
4903  __Pyx_INCREF(__pyx_v_filebase);
4904 
4905  /* "cpartitioning.pyx":66
4906  *
4907  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4908  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
4909  * if not isinstance(filebase, bytes):
4910  * filebase = filebase.encode()
4911  */
4912  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
4913 
4914  /* "cpartitioning.pyx":67
4915  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4916  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4917  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
4918  * filebase = filebase.encode()
4919  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4920  */
4921  __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
4922  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
4923  if (__pyx_t_2) {
4924 
4925  /* "cpartitioning.pyx":68
4926  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4927  * if not isinstance(filebase, bytes):
4928  * filebase = filebase.encode() # <<<<<<<<<<<<<<
4929  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4930  * <const char*>(<char*>filebase),
4931  */
4932  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filebase, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error)
4933  __Pyx_GOTREF(__pyx_t_4);
4934  __pyx_t_5 = NULL;
4935  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
4936  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
4937  if (likely(__pyx_t_5)) {
4938  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4939  __Pyx_INCREF(__pyx_t_5);
4940  __Pyx_INCREF(function);
4941  __Pyx_DECREF_SET(__pyx_t_4, function);
4942  }
4943  }
4944  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
4945  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4946  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error)
4947  __Pyx_GOTREF(__pyx_t_3);
4948  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4949  __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
4950  __pyx_t_3 = 0;
4951 
4952  /* "cpartitioning.pyx":67
4953  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4954  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4955  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
4956  * filebase = filebase.encode()
4957  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4958  */
4959  }
4960 
4961  /* "cpartitioning.pyx":70
4962  * filebase = filebase.encode()
4963  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4964  * <const char*>(<char*>filebase), # <<<<<<<<<<<<<<
4965  * indexBase,
4966  * cmesh.mesh,
4967  */
4968  __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L1_error)
4969 
4970  /* "cpartitioning.pyx":69
4971  * if not isinstance(filebase, bytes):
4972  * filebase = filebase.encode()
4973  * c_partitionNodesFromTetgenFiles(comm.ob_mpi, # <<<<<<<<<<<<<<
4974  * <const char*>(<char*>filebase),
4975  * indexBase,
4976  */
4977  (void)(proteus::partitionNodesFromTetgenFiles(__pyx_v_comm->ob_mpi, ((char const *)((char *)__pyx_t_6)), __pyx_v_indexBase, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
4978 
4979  /* "cpartitioning.pyx":74
4980  * cmesh.mesh,
4981  * nLayersOfOverlap)
4982  * return ( # <<<<<<<<<<<<<<
4983  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4984  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4985  */
4986  __Pyx_XDECREF(__pyx_r);
4987 
4988  /* "cpartitioning.pyx":75
4989  * nLayersOfOverlap)
4990  * return (
4991  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4992  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4993  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4994  */
4995  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
4996  __Pyx_GOTREF(__pyx_t_4);
4997  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
4998  __Pyx_GOTREF(__pyx_t_5);
4999  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5000  __pyx_t_7 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
5001  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
5002  __Pyx_GOTREF(__pyx_t_4);
5003  __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 75, __pyx_L1_error)
5004  __Pyx_GOTREF(__pyx_t_8);
5005  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5006  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error)
5007  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5008  if (!__pyx_t_7) {
5009  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5010  __PYX_ERR(0, 75, __pyx_L1_error)
5011  }
5012  __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5013  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9));
5014  if (unlikely(!__pyx_t_4 || !__pyx_t_8 || !PyBytes_AsString(__pyx_t_4))) __PYX_ERR(0, 75, __pyx_L1_error)
5015  __Pyx_GOTREF(__pyx_t_4);
5016  __Pyx_GOTREF(__pyx_t_8);
5017  __pyx_t_10 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_t_7);
5018  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 75, __pyx_L1_error)
5019  __Pyx_GOTREF(__pyx_t_10);
5020  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5021  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5022  __pyx_t_4 = NULL;
5023  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5024  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5025  if (likely(__pyx_t_4)) {
5026  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5027  __Pyx_INCREF(__pyx_t_4);
5028  __Pyx_INCREF(function);
5029  __Pyx_DECREF_SET(__pyx_t_5, function);
5030  }
5031  }
5032  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_10));
5033  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5034  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5035  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
5036  __Pyx_GOTREF(__pyx_t_3);
5037  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5038 
5039  /* "cpartitioning.pyx":76
5040  * return (
5041  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5042  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
5043  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5044  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5045  */
5046  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5047  __Pyx_GOTREF(__pyx_t_4);
5048  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
5049  __Pyx_GOTREF(__pyx_t_8);
5050  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5051  __pyx_t_7 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
5052  if (!__pyx_t_7) {
5053  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5054  __PYX_ERR(0, 76, __pyx_L1_error)
5055  }
5056  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5057  __pyx_t_4 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
5058  if (unlikely(!__pyx_t_11 || !__pyx_t_4 || !PyBytes_AsString(__pyx_t_11))) __PYX_ERR(0, 76, __pyx_L1_error)
5059  __Pyx_GOTREF(__pyx_t_11);
5060  __Pyx_GOTREF(__pyx_t_4);
5061  __pyx_t_10 = __pyx_array_new(__pyx_t_4, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5062  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error)
5063  __Pyx_GOTREF(__pyx_t_10);
5064  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5065  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5066  __pyx_t_11 = NULL;
5067  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5068  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
5069  if (likely(__pyx_t_11)) {
5070  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
5071  __Pyx_INCREF(__pyx_t_11);
5072  __Pyx_INCREF(function);
5073  __Pyx_DECREF_SET(__pyx_t_8, function);
5074  }
5075  }
5076  __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_10));
5077  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5078  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5079  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
5080  __Pyx_GOTREF(__pyx_t_5);
5081  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5082 
5083  /* "cpartitioning.pyx":77
5084  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5085  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5086  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5087  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5088  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5089  */
5090  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L1_error)
5091  __Pyx_GOTREF(__pyx_t_11);
5092  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
5093  __Pyx_GOTREF(__pyx_t_4);
5094  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5095  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
5096  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L1_error)
5097  __Pyx_GOTREF(__pyx_t_11);
5098  __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_11, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 77, __pyx_L1_error)
5099  __Pyx_GOTREF(__pyx_t_12);
5100  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5101  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error)
5102  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5103  if (!__pyx_t_7) {
5104  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5105  __PYX_ERR(0, 77, __pyx_L1_error)
5106  }
5107  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5108  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9));
5109  if (unlikely(!__pyx_t_11 || !__pyx_t_12 || !PyBytes_AsString(__pyx_t_11))) __PYX_ERR(0, 77, __pyx_L1_error)
5110  __Pyx_GOTREF(__pyx_t_11);
5111  __Pyx_GOTREF(__pyx_t_12);
5112  __pyx_t_10 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5113  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 77, __pyx_L1_error)
5114  __Pyx_GOTREF(__pyx_t_10);
5115  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5116  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5117  __pyx_t_11 = NULL;
5118  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5119  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
5120  if (likely(__pyx_t_11)) {
5121  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5122  __Pyx_INCREF(__pyx_t_11);
5123  __Pyx_INCREF(function);
5124  __Pyx_DECREF_SET(__pyx_t_4, function);
5125  }
5126  }
5127  __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_10));
5128  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5129  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5130  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 77, __pyx_L1_error)
5131  __Pyx_GOTREF(__pyx_t_8);
5132  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5133 
5134  /* "cpartitioning.pyx":78
5135  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5136  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5137  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
5138  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5139  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5140  */
5141  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5142  __Pyx_GOTREF(__pyx_t_11);
5143  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 78, __pyx_L1_error)
5144  __Pyx_GOTREF(__pyx_t_12);
5145  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5146  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
5147  if (!__pyx_t_7) {
5148  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5149  __PYX_ERR(0, 78, __pyx_L1_error)
5150  }
5151  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5152  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
5153  if (unlikely(!__pyx_t_13 || !__pyx_t_11 || !PyBytes_AsString(__pyx_t_13))) __PYX_ERR(0, 78, __pyx_L1_error)
5154  __Pyx_GOTREF(__pyx_t_13);
5155  __Pyx_GOTREF(__pyx_t_11);
5156  __pyx_t_10 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5157  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error)
5158  __Pyx_GOTREF(__pyx_t_10);
5159  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5160  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5161  __pyx_t_13 = NULL;
5162  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
5163  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
5164  if (likely(__pyx_t_13)) {
5165  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
5166  __Pyx_INCREF(__pyx_t_13);
5167  __Pyx_INCREF(function);
5168  __Pyx_DECREF_SET(__pyx_t_12, function);
5169  }
5170  }
5171  __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_t_10));
5172  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5173  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5174  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
5175  __Pyx_GOTREF(__pyx_t_4);
5176  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5177 
5178  /* "cpartitioning.pyx":79
5179  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5180  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5181  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5182  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5183  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5184  */
5185  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 79, __pyx_L1_error)
5186  __Pyx_GOTREF(__pyx_t_13);
5187  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 79, __pyx_L1_error)
5188  __Pyx_GOTREF(__pyx_t_11);
5189  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5190  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
5191  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 79, __pyx_L1_error)
5192  __Pyx_GOTREF(__pyx_t_13);
5193  __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_13, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 79, __pyx_L1_error)
5194  __Pyx_GOTREF(__pyx_t_14);
5195  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5196  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error)
5197  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5198  if (!__pyx_t_7) {
5199  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5200  __PYX_ERR(0, 79, __pyx_L1_error)
5201  }
5202  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5203  __pyx_t_14 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9));
5204  if (unlikely(!__pyx_t_13 || !__pyx_t_14 || !PyBytes_AsString(__pyx_t_13))) __PYX_ERR(0, 79, __pyx_L1_error)
5205  __Pyx_GOTREF(__pyx_t_13);
5206  __Pyx_GOTREF(__pyx_t_14);
5207  __pyx_t_10 = __pyx_array_new(__pyx_t_14, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5208  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 79, __pyx_L1_error)
5209  __Pyx_GOTREF(__pyx_t_10);
5210  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5211  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5212  __pyx_t_13 = NULL;
5213  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
5214  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
5215  if (likely(__pyx_t_13)) {
5216  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
5217  __Pyx_INCREF(__pyx_t_13);
5218  __Pyx_INCREF(function);
5219  __Pyx_DECREF_SET(__pyx_t_11, function);
5220  }
5221  }
5222  __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_10));
5223  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5224  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5225  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 79, __pyx_L1_error)
5226  __Pyx_GOTREF(__pyx_t_12);
5227  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5228 
5229  /* "cpartitioning.pyx":80
5230  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5231  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5232  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
5233  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5234  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5235  */
5236  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5237  __Pyx_GOTREF(__pyx_t_13);
5238  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L1_error)
5239  __Pyx_GOTREF(__pyx_t_14);
5240  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5241  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
5242  if (!__pyx_t_7) {
5243  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5244  __PYX_ERR(0, 80, __pyx_L1_error)
5245  }
5246  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5247  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
5248  if (unlikely(!__pyx_t_15 || !__pyx_t_13 || !PyBytes_AsString(__pyx_t_15))) __PYX_ERR(0, 80, __pyx_L1_error)
5249  __Pyx_GOTREF(__pyx_t_15);
5250  __Pyx_GOTREF(__pyx_t_13);
5251  __pyx_t_10 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
5252  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L1_error)
5253  __Pyx_GOTREF(__pyx_t_10);
5254  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5255  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5256  __pyx_t_15 = NULL;
5257  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
5258  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
5259  if (likely(__pyx_t_15)) {
5260  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
5261  __Pyx_INCREF(__pyx_t_15);
5262  __Pyx_INCREF(function);
5263  __Pyx_DECREF_SET(__pyx_t_14, function);
5264  }
5265  }
5266  __pyx_t_11 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_14, ((PyObject *)__pyx_t_10));
5267  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5268  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5269  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 80, __pyx_L1_error)
5270  __Pyx_GOTREF(__pyx_t_11);
5271  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5272 
5273  /* "cpartitioning.pyx":81
5274  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5275  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5276  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5277  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5278  * )
5279  */
5280  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 81, __pyx_L1_error)
5281  __Pyx_GOTREF(__pyx_t_15);
5282  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 81, __pyx_L1_error)
5283  __Pyx_GOTREF(__pyx_t_13);
5284  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5285  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
5286  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 81, __pyx_L1_error)
5287  __Pyx_GOTREF(__pyx_t_15);
5288  __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_15, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 81, __pyx_L1_error)
5289  __Pyx_GOTREF(__pyx_t_16);
5290  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5291  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error)
5292  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5293  if (!__pyx_t_7) {
5294  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5295  __PYX_ERR(0, 81, __pyx_L1_error)
5296  }
5297  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5298  __pyx_t_16 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9));
5299  if (unlikely(!__pyx_t_15 || !__pyx_t_16 || !PyBytes_AsString(__pyx_t_15))) __PYX_ERR(0, 81, __pyx_L1_error)
5300  __Pyx_GOTREF(__pyx_t_15);
5301  __Pyx_GOTREF(__pyx_t_16);
5302  __pyx_t_10 = __pyx_array_new(__pyx_t_16, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
5303  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 81, __pyx_L1_error)
5304  __Pyx_GOTREF(__pyx_t_10);
5305  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5306  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5307  __pyx_t_15 = NULL;
5308  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
5309  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
5310  if (likely(__pyx_t_15)) {
5311  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
5312  __Pyx_INCREF(__pyx_t_15);
5313  __Pyx_INCREF(function);
5314  __Pyx_DECREF_SET(__pyx_t_13, function);
5315  }
5316  }
5317  __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_10));
5318  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5319  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5320  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 81, __pyx_L1_error)
5321  __Pyx_GOTREF(__pyx_t_14);
5322  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5323 
5324  /* "cpartitioning.pyx":82
5325  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5326  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5327  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
5328  * )
5329  *
5330  */
5331  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5332  __Pyx_GOTREF(__pyx_t_15);
5333  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 82, __pyx_L1_error)
5334  __Pyx_GOTREF(__pyx_t_16);
5335  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5336  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
5337  if (!__pyx_t_7) {
5338  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5339  __PYX_ERR(0, 82, __pyx_L1_error)
5340  }
5341  __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5342  __pyx_t_15 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
5343  if (unlikely(!__pyx_t_17 || !__pyx_t_15 || !PyBytes_AsString(__pyx_t_17))) __PYX_ERR(0, 82, __pyx_L1_error)
5344  __Pyx_GOTREF(__pyx_t_17);
5345  __Pyx_GOTREF(__pyx_t_15);
5346  __pyx_t_10 = __pyx_array_new(__pyx_t_15, sizeof(int), PyBytes_AS_STRING(__pyx_t_17), (char *) "c", (char *) __pyx_t_7);
5347  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 82, __pyx_L1_error)
5348  __Pyx_GOTREF(__pyx_t_10);
5349  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5350  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5351  __pyx_t_17 = NULL;
5352  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
5353  __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
5354  if (likely(__pyx_t_17)) {
5355  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
5356  __Pyx_INCREF(__pyx_t_17);
5357  __Pyx_INCREF(function);
5358  __Pyx_DECREF_SET(__pyx_t_16, function);
5359  }
5360  }
5361  __pyx_t_13 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_17, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_16, ((PyObject *)__pyx_t_10));
5362  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
5363  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5364  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 82, __pyx_L1_error)
5365  __Pyx_GOTREF(__pyx_t_13);
5366  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5367 
5368  /* "cpartitioning.pyx":75
5369  * nLayersOfOverlap)
5370  * return (
5371  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5372  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5373  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5374  */
5375  __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 75, __pyx_L1_error)
5376  __Pyx_GOTREF(__pyx_t_16);
5377  __Pyx_GIVEREF(__pyx_t_3);
5378  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3);
5379  __Pyx_GIVEREF(__pyx_t_5);
5380  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
5381  __Pyx_GIVEREF(__pyx_t_8);
5382  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_8);
5383  __Pyx_GIVEREF(__pyx_t_4);
5384  PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_4);
5385  __Pyx_GIVEREF(__pyx_t_12);
5386  PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12);
5387  __Pyx_GIVEREF(__pyx_t_11);
5388  PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11);
5389  __Pyx_GIVEREF(__pyx_t_14);
5390  PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14);
5391  __Pyx_GIVEREF(__pyx_t_13);
5392  PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13);
5393  __pyx_t_3 = 0;
5394  __pyx_t_5 = 0;
5395  __pyx_t_8 = 0;
5396  __pyx_t_4 = 0;
5397  __pyx_t_12 = 0;
5398  __pyx_t_11 = 0;
5399  __pyx_t_14 = 0;
5400  __pyx_t_13 = 0;
5401  __pyx_r = __pyx_t_16;
5402  __pyx_t_16 = 0;
5403  goto __pyx_L0;
5404 
5405  /* "cpartitioning.pyx":65
5406  * )
5407  *
5408  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
5409  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5410  * if not isinstance(filebase, bytes):
5411  */
5412 
5413  /* function exit code */
5414  __pyx_L1_error:;
5415  __Pyx_XDECREF(__pyx_t_3);
5416  __Pyx_XDECREF(__pyx_t_4);
5417  __Pyx_XDECREF(__pyx_t_5);
5418  __Pyx_XDECREF(__pyx_t_8);
5419  __Pyx_XDECREF(((PyObject *)__pyx_t_10));
5420  __Pyx_XDECREF(__pyx_t_11);
5421  __Pyx_XDECREF(__pyx_t_12);
5422  __Pyx_XDECREF(__pyx_t_13);
5423  __Pyx_XDECREF(__pyx_t_14);
5424  __Pyx_XDECREF(__pyx_t_15);
5425  __Pyx_XDECREF(__pyx_t_16);
5426  __Pyx_XDECREF(__pyx_t_17);
5427  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
5428  __pyx_r = NULL;
5429  __pyx_L0:;
5430  __Pyx_XDECREF(__pyx_v_filebase);
5431  __Pyx_XGIVEREF(__pyx_r);
5432  __Pyx_RefNannyFinishContext();
5433  return __pyx_r;
5434 }
5435 
5436 /* "cpartitioning.pyx":85
5437  * )
5438  *
5439  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
5440  * int nSpace,
5441  * cmeshTools.CMesh cmesh,
5442  */
5443 
5444 /* Python wrapper */
5445 static PyObject *__pyx_pw_13cpartitioning_9buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5446 static PyMethodDef __pyx_mdef_13cpartitioning_9buildQuadraticLocal2GlobalMappings = {"buildQuadraticLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_9buildQuadraticLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
5447 static PyObject *__pyx_pw_13cpartitioning_9buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5448  struct PyMPICommObject *__pyx_v_comm = 0;
5449  int __pyx_v_nSpace;
5450  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
5451  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
5452  PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
5453  PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
5454  PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
5455  PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
5456  PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
5457  PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
5458  PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
5459  PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
5460  PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
5461  PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
5462  PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
5463  PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
5464  PyObject *__pyx_r = 0;
5465  __Pyx_RefNannyDeclarations
5466  __Pyx_RefNannySetupContext("buildQuadraticLocal2GlobalMappings (wrapper)", 0);
5467  {
5468  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nSpace,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_nodeOffsets_subdomain_owned,&__pyx_n_s_elementBoundaryOffsets_subdomain,&__pyx_n_s_edgeOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_nodeNumbering_subdomain2global,&__pyx_n_s_elementBoundaryNumbering_subdoma,&__pyx_n_s_edgeNumbering_subdomain2global,&__pyx_n_s_quadratic_dof_offsets_subdomain,&__pyx_n_s_quadratic_subdomain_l2g,&__pyx_n_s_quadraticNumbering_subdomain2glo,&__pyx_n_s_quadratic_lagrangeNodes,0};
5469  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
5470  if (unlikely(__pyx_kwds)) {
5471  Py_ssize_t kw_args;
5472  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5473  switch (pos_args) {
5474  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5475  CYTHON_FALLTHROUGH;
5476  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5477  CYTHON_FALLTHROUGH;
5478  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5479  CYTHON_FALLTHROUGH;
5480  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5481  CYTHON_FALLTHROUGH;
5482  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5483  CYTHON_FALLTHROUGH;
5484  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5485  CYTHON_FALLTHROUGH;
5486  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5487  CYTHON_FALLTHROUGH;
5488  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5489  CYTHON_FALLTHROUGH;
5490  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5491  CYTHON_FALLTHROUGH;
5492  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5493  CYTHON_FALLTHROUGH;
5494  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5495  CYTHON_FALLTHROUGH;
5496  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5497  CYTHON_FALLTHROUGH;
5498  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5499  CYTHON_FALLTHROUGH;
5500  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5501  CYTHON_FALLTHROUGH;
5502  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5503  CYTHON_FALLTHROUGH;
5504  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5505  CYTHON_FALLTHROUGH;
5506  case 0: break;
5507  default: goto __pyx_L5_argtuple_error;
5508  }
5509  kw_args = PyDict_Size(__pyx_kwds);
5510  switch (pos_args) {
5511  case 0:
5512  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
5513  else goto __pyx_L5_argtuple_error;
5514  CYTHON_FALLTHROUGH;
5515  case 1:
5516  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
5517  else {
5518  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 85, __pyx_L3_error)
5519  }
5520  CYTHON_FALLTHROUGH;
5521  case 2:
5522  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
5523  else {
5524  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 85, __pyx_L3_error)
5525  }
5526  CYTHON_FALLTHROUGH;
5527  case 3:
5528  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
5529  else {
5530  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 85, __pyx_L3_error)
5531  }
5532  CYTHON_FALLTHROUGH;
5533  case 4:
5534  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
5535  else {
5536  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 85, __pyx_L3_error)
5537  }
5538  CYTHON_FALLTHROUGH;
5539  case 5:
5540  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
5541  else {
5542  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 85, __pyx_L3_error)
5543  }
5544  CYTHON_FALLTHROUGH;
5545  case 6:
5546  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
5547  else {
5548  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 85, __pyx_L3_error)
5549  }
5550  CYTHON_FALLTHROUGH;
5551  case 7:
5552  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
5553  else {
5554  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 85, __pyx_L3_error)
5555  }
5556  CYTHON_FALLTHROUGH;
5557  case 8:
5558  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
5559  else {
5560  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 85, __pyx_L3_error)
5561  }
5562  CYTHON_FALLTHROUGH;
5563  case 9:
5564  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
5565  else {
5566  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 85, __pyx_L3_error)
5567  }
5568  CYTHON_FALLTHROUGH;
5569  case 10:
5570  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;
5571  else {
5572  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 10); __PYX_ERR(0, 85, __pyx_L3_error)
5573  }
5574  CYTHON_FALLTHROUGH;
5575  case 11:
5576  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeNumbering_subdomain2global)) != 0)) kw_args--;
5577  else {
5578  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 11); __PYX_ERR(0, 85, __pyx_L3_error)
5579  }
5580  CYTHON_FALLTHROUGH;
5581  case 12:
5582  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_dof_offsets_subdomain)) != 0)) kw_args--;
5583  else {
5584  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 12); __PYX_ERR(0, 85, __pyx_L3_error)
5585  }
5586  CYTHON_FALLTHROUGH;
5587  case 13:
5588  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_subdomain_l2g)) != 0)) kw_args--;
5589  else {
5590  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 13); __PYX_ERR(0, 85, __pyx_L3_error)
5591  }
5592  CYTHON_FALLTHROUGH;
5593  case 14:
5594  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadraticNumbering_subdomain2glo)) != 0)) kw_args--;
5595  else {
5596  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 14); __PYX_ERR(0, 85, __pyx_L3_error)
5597  }
5598  CYTHON_FALLTHROUGH;
5599  case 15:
5600  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_lagrangeNodes)) != 0)) kw_args--;
5601  else {
5602  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 15); __PYX_ERR(0, 85, __pyx_L3_error)
5603  }
5604  }
5605  if (unlikely(kw_args > 0)) {
5606  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildQuadraticLocal2GlobalMappings") < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
5607  }
5608  } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
5609  goto __pyx_L5_argtuple_error;
5610  } else {
5611  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5612  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5613  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5614  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5615  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5616  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5617  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5618  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5619  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5620  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5621  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5622  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5623  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5624  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5625  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5626  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5627  }
5628  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
5629  __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
5630  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
5631  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
5632  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
5633  __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
5634  __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
5635  __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
5636  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
5637  __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
5638  __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
5639  __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
5640  __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
5641  __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
5642  __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
5643  __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
5644  }
5645  goto __pyx_L4_argument_unpacking_done;
5646  __pyx_L5_argtuple_error:;
5647  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error)
5648  __pyx_L3_error:;
5649  __Pyx_AddTraceback("cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
5650  __Pyx_RefNannyFinishContext();
5651  return NULL;
5652  __pyx_L4_argument_unpacking_done:;
5653  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 85, __pyx_L1_error)
5654  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 87, __pyx_L1_error)
5655  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 88, __pyx_L1_error)
5656  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 89, __pyx_L1_error)
5657  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 90, __pyx_L1_error)
5658  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 91, __pyx_L1_error)
5659  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 92, __pyx_L1_error)
5660  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 93, __pyx_L1_error)
5661  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 94, __pyx_L1_error)
5662  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 95, __pyx_L1_error)
5663  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 96, __pyx_L1_error)
5664  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 97, __pyx_L1_error)
5665  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 98, __pyx_L1_error)
5666  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 99, __pyx_L1_error)
5667  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_ptype_5numpy_ndarray, 1, "quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 100, __pyx_L1_error)
5668  __pyx_r = __pyx_pf_13cpartitioning_8buildQuadraticLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
5669 
5670  /* function exit code */
5671  goto __pyx_L0;
5672  __pyx_L1_error:;
5673  __pyx_r = NULL;
5674  __pyx_L0:;
5675  __Pyx_RefNannyFinishContext();
5676  return __pyx_r;
5677 }
5678 
5679 static PyObject *__pyx_pf_13cpartitioning_8buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
5680  int __pyx_v_nDOF_all_processes;
5681  int __pyx_v_nDOF_subdomain;
5682  int __pyx_v_max_dof_neighbors;
5683  PyObject *__pyx_r = NULL;
5684  __Pyx_RefNannyDeclarations
5685  PyObject *__pyx_t_1 = NULL;
5686  PyObject *__pyx_t_2 = NULL;
5687  PyObject *__pyx_t_3 = NULL;
5688  PyObject *__pyx_t_4 = NULL;
5689  __Pyx_RefNannySetupContext("buildQuadraticLocal2GlobalMappings", 0);
5690 
5691  /* "cpartitioning.pyx":101
5692  * np.ndarray quadraticNumbering_subdomain2global,
5693  * np.ndarray quadratic_lagrangeNodes):
5694  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
5695  * cdef int nDOF_subdomain=0
5696  * cdef int max_dof_neighbors=0
5697  */
5698  __pyx_v_nDOF_all_processes = 0;
5699 
5700  /* "cpartitioning.pyx":102
5701  * np.ndarray quadratic_lagrangeNodes):
5702  * cdef int nDOF_all_processes=0
5703  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
5704  * cdef int max_dof_neighbors=0
5705  * if nSpace == 1:
5706  */
5707  __pyx_v_nDOF_subdomain = 0;
5708 
5709  /* "cpartitioning.pyx":103
5710  * cdef int nDOF_all_processes=0
5711  * cdef int nDOF_subdomain=0
5712  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
5713  * if nSpace == 1:
5714  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
5715  */
5716  __pyx_v_max_dof_neighbors = 0;
5717 
5718  /* "cpartitioning.pyx":104
5719  * cdef int nDOF_subdomain=0
5720  * cdef int max_dof_neighbors=0
5721  * if nSpace == 1: # <<<<<<<<<<<<<<
5722  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
5723  * cmesh.mesh,
5724  */
5725  switch (__pyx_v_nSpace) {
5726  case 1:
5727 
5728  /* "cpartitioning.pyx":105
5729  * cdef int max_dof_neighbors=0
5730  * if nSpace == 1:
5731  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi, # <<<<<<<<<<<<<<
5732  * cmesh.mesh,
5733  * <int*>(elementOffsets_subdomain_owned.data),
5734  */
5735  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_1d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_elementNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
5736 
5737  /* "cpartitioning.pyx":104
5738  * cdef int nDOF_subdomain=0
5739  * cdef int max_dof_neighbors=0
5740  * if nSpace == 1: # <<<<<<<<<<<<<<
5741  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
5742  * cmesh.mesh,
5743  */
5744  break;
5745  case 2:
5746 
5747  /* "cpartitioning.pyx":119
5748  * <double*>(quadratic_lagrangeNodes.data));
5749  * elif nSpace == 2:
5750  * buildQuadraticSubdomain2GlobalMappings_2d(comm.ob_mpi, # <<<<<<<<<<<<<<
5751  * cmesh.mesh,
5752  * <int*>(elementBoundaryOffsets_subdomain_owned.data),
5753  */
5754  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_2d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementBoundaryOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_elementBoundaryNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
5755 
5756  /* "cpartitioning.pyx":118
5757  * <int*>(quadraticNumbering_subdomain2global.data),
5758  * <double*>(quadratic_lagrangeNodes.data));
5759  * elif nSpace == 2: # <<<<<<<<<<<<<<
5760  * buildQuadraticSubdomain2GlobalMappings_2d(comm.ob_mpi,
5761  * cmesh.mesh,
5762  */
5763  break;
5764  default:
5765 
5766  /* "cpartitioning.pyx":133
5767  * <double*>(quadratic_lagrangeNodes.data))
5768  * else:
5769  * buildQuadraticSubdomain2GlobalMappings_3d(comm.ob_mpi, # <<<<<<<<<<<<<<
5770  * cmesh.mesh,
5771  * <int*>(edgeOffsets_subdomain_owned.data),
5772  */
5773  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_edgeOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_edgeNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
5774  break;
5775  }
5776 
5777  /* "cpartitioning.pyx":146
5778  * <int*>(quadraticNumbering_subdomain2global.data),
5779  * <double*>(quadratic_lagrangeNodes.data))
5780  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
5781  * nDOF_subdomain,
5782  * max_dof_neighbors)
5783  */
5784  __Pyx_XDECREF(__pyx_r);
5785  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
5786  __Pyx_GOTREF(__pyx_t_1);
5787 
5788  /* "cpartitioning.pyx":147
5789  * <double*>(quadratic_lagrangeNodes.data))
5790  * return (nDOF_all_processes,
5791  * nDOF_subdomain, # <<<<<<<<<<<<<<
5792  * max_dof_neighbors)
5793  *
5794  */
5795  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
5796  __Pyx_GOTREF(__pyx_t_2);
5797 
5798  /* "cpartitioning.pyx":148
5799  * return (nDOF_all_processes,
5800  * nDOF_subdomain,
5801  * max_dof_neighbors) # <<<<<<<<<<<<<<
5802  *
5803  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm,
5804  */
5805  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
5806  __Pyx_GOTREF(__pyx_t_3);
5807 
5808  /* "cpartitioning.pyx":146
5809  * <int*>(quadraticNumbering_subdomain2global.data),
5810  * <double*>(quadratic_lagrangeNodes.data))
5811  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
5812  * nDOF_subdomain,
5813  * max_dof_neighbors)
5814  */
5815  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
5816  __Pyx_GOTREF(__pyx_t_4);
5817  __Pyx_GIVEREF(__pyx_t_1);
5818  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5819  __Pyx_GIVEREF(__pyx_t_2);
5820  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
5821  __Pyx_GIVEREF(__pyx_t_3);
5822  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
5823  __pyx_t_1 = 0;
5824  __pyx_t_2 = 0;
5825  __pyx_t_3 = 0;
5826  __pyx_r = __pyx_t_4;
5827  __pyx_t_4 = 0;
5828  goto __pyx_L0;
5829 
5830  /* "cpartitioning.pyx":85
5831  * )
5832  *
5833  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
5834  * int nSpace,
5835  * cmeshTools.CMesh cmesh,
5836  */
5837 
5838  /* function exit code */
5839  __pyx_L1_error:;
5840  __Pyx_XDECREF(__pyx_t_1);
5841  __Pyx_XDECREF(__pyx_t_2);
5842  __Pyx_XDECREF(__pyx_t_3);
5843  __Pyx_XDECREF(__pyx_t_4);
5844  __Pyx_AddTraceback("cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
5845  __pyx_r = NULL;
5846  __pyx_L0:;
5847  __Pyx_XGIVEREF(__pyx_r);
5848  __Pyx_RefNannyFinishContext();
5849  return __pyx_r;
5850 }
5851 
5852 /* "cpartitioning.pyx":150
5853  * max_dof_neighbors)
5854  *
5855  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
5856  * int nSpace,
5857  * cmeshTools.CMesh cmesh,
5858  */
5859 
5860 /* Python wrapper */
5861 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5862 static PyMethodDef __pyx_mdef_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings = {"buildQuadraticCubeLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
5863 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5864  struct PyMPICommObject *__pyx_v_comm = 0;
5865  int __pyx_v_nSpace;
5866  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
5867  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
5868  CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
5869  PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
5870  CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
5871  PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
5872  CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
5873  PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
5874  CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
5875  PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
5876  PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
5877  PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
5878  PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
5879  PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
5880  PyObject *__pyx_r = 0;
5881  __Pyx_RefNannyDeclarations
5882  __Pyx_RefNannySetupContext("buildQuadraticCubeLocal2GlobalMappings (wrapper)", 0);
5883  {
5884  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nSpace,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_nodeOffsets_subdomain_owned,&__pyx_n_s_elementBoundaryOffsets_subdomain,&__pyx_n_s_edgeOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_nodeNumbering_subdomain2global,&__pyx_n_s_elementBoundaryNumbering_subdoma,&__pyx_n_s_edgeNumbering_subdomain2global,&__pyx_n_s_quadratic_dof_offsets_subdomain,&__pyx_n_s_quadratic_subdomain_l2g,&__pyx_n_s_quadraticNumbering_subdomain2glo,&__pyx_n_s_quadratic_lagrangeNodes,0};
5885  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
5886  if (unlikely(__pyx_kwds)) {
5887  Py_ssize_t kw_args;
5888  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5889  switch (pos_args) {
5890  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5891  CYTHON_FALLTHROUGH;
5892  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5893  CYTHON_FALLTHROUGH;
5894  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5895  CYTHON_FALLTHROUGH;
5896  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5897  CYTHON_FALLTHROUGH;
5898  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5899  CYTHON_FALLTHROUGH;
5900  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5901  CYTHON_FALLTHROUGH;
5902  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5903  CYTHON_FALLTHROUGH;
5904  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5905  CYTHON_FALLTHROUGH;
5906  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5907  CYTHON_FALLTHROUGH;
5908  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5909  CYTHON_FALLTHROUGH;
5910  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5911  CYTHON_FALLTHROUGH;
5912  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5913  CYTHON_FALLTHROUGH;
5914  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5915  CYTHON_FALLTHROUGH;
5916  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5917  CYTHON_FALLTHROUGH;
5918  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5919  CYTHON_FALLTHROUGH;
5920  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5921  CYTHON_FALLTHROUGH;
5922  case 0: break;
5923  default: goto __pyx_L5_argtuple_error;
5924  }
5925  kw_args = PyDict_Size(__pyx_kwds);
5926  switch (pos_args) {
5927  case 0:
5928  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
5929  else goto __pyx_L5_argtuple_error;
5930  CYTHON_FALLTHROUGH;
5931  case 1:
5932  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
5933  else {
5934  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 150, __pyx_L3_error)
5935  }
5936  CYTHON_FALLTHROUGH;
5937  case 2:
5938  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
5939  else {
5940  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 150, __pyx_L3_error)
5941  }
5942  CYTHON_FALLTHROUGH;
5943  case 3:
5944  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
5945  else {
5946  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 150, __pyx_L3_error)
5947  }
5948  CYTHON_FALLTHROUGH;
5949  case 4:
5950  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
5951  else {
5952  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 150, __pyx_L3_error)
5953  }
5954  CYTHON_FALLTHROUGH;
5955  case 5:
5956  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
5957  else {
5958  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 150, __pyx_L3_error)
5959  }
5960  CYTHON_FALLTHROUGH;
5961  case 6:
5962  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
5963  else {
5964  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 150, __pyx_L3_error)
5965  }
5966  CYTHON_FALLTHROUGH;
5967  case 7:
5968  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
5969  else {
5970  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 150, __pyx_L3_error)
5971  }
5972  CYTHON_FALLTHROUGH;
5973  case 8:
5974  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
5975  else {
5976  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 150, __pyx_L3_error)
5977  }
5978  CYTHON_FALLTHROUGH;
5979  case 9:
5980  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
5981  else {
5982  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 150, __pyx_L3_error)
5983  }
5984  CYTHON_FALLTHROUGH;
5985  case 10:
5986  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;
5987  else {
5988  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 10); __PYX_ERR(0, 150, __pyx_L3_error)
5989  }
5990  CYTHON_FALLTHROUGH;
5991  case 11:
5992  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeNumbering_subdomain2global)) != 0)) kw_args--;
5993  else {
5994  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 11); __PYX_ERR(0, 150, __pyx_L3_error)
5995  }
5996  CYTHON_FALLTHROUGH;
5997  case 12:
5998  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_dof_offsets_subdomain)) != 0)) kw_args--;
5999  else {
6000  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 12); __PYX_ERR(0, 150, __pyx_L3_error)
6001  }
6002  CYTHON_FALLTHROUGH;
6003  case 13:
6004  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_subdomain_l2g)) != 0)) kw_args--;
6005  else {
6006  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 13); __PYX_ERR(0, 150, __pyx_L3_error)
6007  }
6008  CYTHON_FALLTHROUGH;
6009  case 14:
6010  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadraticNumbering_subdomain2glo)) != 0)) kw_args--;
6011  else {
6012  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 14); __PYX_ERR(0, 150, __pyx_L3_error)
6013  }
6014  CYTHON_FALLTHROUGH;
6015  case 15:
6016  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_lagrangeNodes)) != 0)) kw_args--;
6017  else {
6018  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 15); __PYX_ERR(0, 150, __pyx_L3_error)
6019  }
6020  }
6021  if (unlikely(kw_args > 0)) {
6022  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildQuadraticCubeLocal2GlobalMappings") < 0)) __PYX_ERR(0, 150, __pyx_L3_error)
6023  }
6024  } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
6025  goto __pyx_L5_argtuple_error;
6026  } else {
6027  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6028  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6029  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6030  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6031  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6032  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6033  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6034  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6035  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6036  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6037  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6038  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6039  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6040  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6041  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6042  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6043  }
6044  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
6045  __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error)
6046  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
6047  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
6048  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
6049  __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
6050  __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
6051  __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
6052  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
6053  __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
6054  __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
6055  __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
6056  __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
6057  __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
6058  __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
6059  __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
6060  }
6061  goto __pyx_L4_argument_unpacking_done;
6062  __pyx_L5_argtuple_error:;
6063  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 150, __pyx_L3_error)
6064  __pyx_L3_error:;
6065  __Pyx_AddTraceback("cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6066  __Pyx_RefNannyFinishContext();
6067  return NULL;
6068  __pyx_L4_argument_unpacking_done:;
6069  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 150, __pyx_L1_error)
6070  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 152, __pyx_L1_error)
6071  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 153, __pyx_L1_error)
6072  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 154, __pyx_L1_error)
6073  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 155, __pyx_L1_error)
6074  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 156, __pyx_L1_error)
6075  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 157, __pyx_L1_error)
6076  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 158, __pyx_L1_error)
6077  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 159, __pyx_L1_error)
6078  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 160, __pyx_L1_error)
6079  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 161, __pyx_L1_error)
6080  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 162, __pyx_L1_error)
6081  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 163, __pyx_L1_error)
6082  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 164, __pyx_L1_error)
6083  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_ptype_5numpy_ndarray, 1, "quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 165, __pyx_L1_error)
6084  __pyx_r = __pyx_pf_13cpartitioning_10buildQuadraticCubeLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
6085 
6086  /* function exit code */
6087  goto __pyx_L0;
6088  __pyx_L1_error:;
6089  __pyx_r = NULL;
6090  __pyx_L0:;
6091  __Pyx_RefNannyFinishContext();
6092  return __pyx_r;
6093 }
6094 
6095 static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
6096  int __pyx_v_nDOF_all_processes;
6097  int __pyx_v_nDOF_subdomain;
6098  int __pyx_v_max_dof_neighbors;
6099  PyObject *__pyx_r = NULL;
6100  __Pyx_RefNannyDeclarations
6101  PyObject *__pyx_t_1 = NULL;
6102  PyObject *__pyx_t_2 = NULL;
6103  PyObject *__pyx_t_3 = NULL;
6104  PyObject *__pyx_t_4 = NULL;
6105  __Pyx_RefNannySetupContext("buildQuadraticCubeLocal2GlobalMappings", 0);
6106 
6107  /* "cpartitioning.pyx":166
6108  * np.ndarray quadraticNumbering_subdomain2global,
6109  * np.ndarray quadratic_lagrangeNodes):
6110  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
6111  * cdef int nDOF_subdomain=0
6112  * cdef int max_dof_neighbors=0
6113  */
6114  __pyx_v_nDOF_all_processes = 0;
6115 
6116  /* "cpartitioning.pyx":167
6117  * np.ndarray quadratic_lagrangeNodes):
6118  * cdef int nDOF_all_processes=0
6119  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
6120  * cdef int max_dof_neighbors=0
6121  * if nSpace == 1:
6122  */
6123  __pyx_v_nDOF_subdomain = 0;
6124 
6125  /* "cpartitioning.pyx":168
6126  * cdef int nDOF_all_processes=0
6127  * cdef int nDOF_subdomain=0
6128  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
6129  * if nSpace == 1:
6130  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6131  */
6132  __pyx_v_max_dof_neighbors = 0;
6133 
6134  /* "cpartitioning.pyx":169
6135  * cdef int nDOF_subdomain=0
6136  * cdef int max_dof_neighbors=0
6137  * if nSpace == 1: # <<<<<<<<<<<<<<
6138  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6139  * elif nSpace == 2:
6140  */
6141  switch (__pyx_v_nSpace) {
6142  case 1:
6143 
6144  /* "cpartitioning.pyx":170
6145  * cdef int max_dof_neighbors=0
6146  * if nSpace == 1:
6147  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!" # <<<<<<<<<<<<<<
6148  * elif nSpace == 2:
6149  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6150  */
6151  #ifndef CYTHON_WITHOUT_ASSERTIONS
6152  if (unlikely(!Py_OptimizeFlag)) {
6153  if (unlikely(!0)) {
6154  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_buildQuadraticCubeSubdomain2Glob);
6155  __PYX_ERR(0, 170, __pyx_L1_error)
6156  }
6157  }
6158  #endif
6159 
6160  /* "cpartitioning.pyx":169
6161  * cdef int nDOF_subdomain=0
6162  * cdef int max_dof_neighbors=0
6163  * if nSpace == 1: # <<<<<<<<<<<<<<
6164  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6165  * elif nSpace == 2:
6166  */
6167  break;
6168  case 2:
6169 
6170  /* "cpartitioning.pyx":172
6171  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6172  * elif nSpace == 2:
6173  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!" # <<<<<<<<<<<<<<
6174  * else:
6175  * buildQuadraticCubeSubdomain2GlobalMappings_3d(comm.ob_mpi,
6176  */
6177  #ifndef CYTHON_WITHOUT_ASSERTIONS
6178  if (unlikely(!Py_OptimizeFlag)) {
6179  if (unlikely(!0)) {
6180  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2);
6181  __PYX_ERR(0, 172, __pyx_L1_error)
6182  }
6183  }
6184  #endif
6185 
6186  /* "cpartitioning.pyx":171
6187  * if nSpace == 1:
6188  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6189  * elif nSpace == 2: # <<<<<<<<<<<<<<
6190  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6191  * else:
6192  */
6193  break;
6194  default:
6195 
6196  /* "cpartitioning.pyx":174
6197  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6198  * else:
6199  * buildQuadraticCubeSubdomain2GlobalMappings_3d(comm.ob_mpi, # <<<<<<<<<<<<<<
6200  * cmesh.mesh,
6201  * <int*>(edgeOffsets_subdomain_owned.data),
6202  */
6203  (void)(proteus::buildQuadraticCubeSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_edgeOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_edgeNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
6204  break;
6205  }
6206 
6207  /* "cpartitioning.pyx":187
6208  * <int*>(quadraticNumbering_subdomain2global.data),
6209  * <double*>(quadratic_lagrangeNodes.data))
6210  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6211  * nDOF_subdomain,
6212  * max_dof_neighbors)
6213  */
6214  __Pyx_XDECREF(__pyx_r);
6215  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
6216  __Pyx_GOTREF(__pyx_t_1);
6217 
6218  /* "cpartitioning.pyx":188
6219  * <double*>(quadratic_lagrangeNodes.data))
6220  * return (nDOF_all_processes,
6221  * nDOF_subdomain, # <<<<<<<<<<<<<<
6222  * max_dof_neighbors)
6223  *
6224  */
6225  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
6226  __Pyx_GOTREF(__pyx_t_2);
6227 
6228  /* "cpartitioning.pyx":189
6229  * return (nDOF_all_processes,
6230  * nDOF_subdomain,
6231  * max_dof_neighbors) # <<<<<<<<<<<<<<
6232  *
6233  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm,
6234  */
6235  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
6236  __Pyx_GOTREF(__pyx_t_3);
6237 
6238  /* "cpartitioning.pyx":187
6239  * <int*>(quadraticNumbering_subdomain2global.data),
6240  * <double*>(quadratic_lagrangeNodes.data))
6241  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6242  * nDOF_subdomain,
6243  * max_dof_neighbors)
6244  */
6245  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
6246  __Pyx_GOTREF(__pyx_t_4);
6247  __Pyx_GIVEREF(__pyx_t_1);
6248  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6249  __Pyx_GIVEREF(__pyx_t_2);
6250  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
6251  __Pyx_GIVEREF(__pyx_t_3);
6252  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6253  __pyx_t_1 = 0;
6254  __pyx_t_2 = 0;
6255  __pyx_t_3 = 0;
6256  __pyx_r = __pyx_t_4;
6257  __pyx_t_4 = 0;
6258  goto __pyx_L0;
6259 
6260  /* "cpartitioning.pyx":150
6261  * max_dof_neighbors)
6262  *
6263  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6264  * int nSpace,
6265  * cmeshTools.CMesh cmesh,
6266  */
6267 
6268  /* function exit code */
6269  __pyx_L1_error:;
6270  __Pyx_XDECREF(__pyx_t_1);
6271  __Pyx_XDECREF(__pyx_t_2);
6272  __Pyx_XDECREF(__pyx_t_3);
6273  __Pyx_XDECREF(__pyx_t_4);
6274  __Pyx_AddTraceback("cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6275  __pyx_r = NULL;
6276  __pyx_L0:;
6277  __Pyx_XGIVEREF(__pyx_r);
6278  __Pyx_RefNannyFinishContext();
6279  return __pyx_r;
6280 }
6281 
6282 /* "cpartitioning.pyx":191
6283  * max_dof_neighbors)
6284  *
6285  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6286  * int nDOF_element,
6287  * cmeshTools.CMesh cmesh,
6288  */
6289 
6290 /* Python wrapper */
6291 static PyObject *__pyx_pw_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6292 static PyMethodDef __pyx_mdef_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings = {"buildDiscontinuousGalerkinLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
6293 static PyObject *__pyx_pw_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6294  struct PyMPICommObject *__pyx_v_comm = 0;
6295  int __pyx_v_nDOF_element;
6296  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
6297  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
6298  PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
6299  PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
6300  PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned = 0;
6301  PyArrayObject *__pyx_v_dg_subdomain_l2g = 0;
6302  PyArrayObject *__pyx_v_dgNumbering_subdomain2global = 0;
6303  PyObject *__pyx_r = 0;
6304  __Pyx_RefNannyDeclarations
6305  __Pyx_RefNannySetupContext("buildDiscontinuousGalerkinLocal2GlobalMappings (wrapper)", 0);
6306  {
6307  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nDOF_element,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_dg_dof_offsets_subdomain_owned,&__pyx_n_s_dg_subdomain_l2g,&__pyx_n_s_dgNumbering_subdomain2global,0};
6308  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
6309  if (unlikely(__pyx_kwds)) {
6310  Py_ssize_t kw_args;
6311  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6312  switch (pos_args) {
6313  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6314  CYTHON_FALLTHROUGH;
6315  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6316  CYTHON_FALLTHROUGH;
6317  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6318  CYTHON_FALLTHROUGH;
6319  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6320  CYTHON_FALLTHROUGH;
6321  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6322  CYTHON_FALLTHROUGH;
6323  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6324  CYTHON_FALLTHROUGH;
6325  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6326  CYTHON_FALLTHROUGH;
6327  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6328  CYTHON_FALLTHROUGH;
6329  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6330  CYTHON_FALLTHROUGH;
6331  case 0: break;
6332  default: goto __pyx_L5_argtuple_error;
6333  }
6334  kw_args = PyDict_Size(__pyx_kwds);
6335  switch (pos_args) {
6336  case 0:
6337  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
6338  else goto __pyx_L5_argtuple_error;
6339  CYTHON_FALLTHROUGH;
6340  case 1:
6341  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_element)) != 0)) kw_args--;
6342  else {
6343  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 1); __PYX_ERR(0, 191, __pyx_L3_error)
6344  }
6345  CYTHON_FALLTHROUGH;
6346  case 2:
6347  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
6348  else {
6349  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 2); __PYX_ERR(0, 191, __pyx_L3_error)
6350  }
6351  CYTHON_FALLTHROUGH;
6352  case 3:
6353  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
6354  else {
6355  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 3); __PYX_ERR(0, 191, __pyx_L3_error)
6356  }
6357  CYTHON_FALLTHROUGH;
6358  case 4:
6359  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
6360  else {
6361  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 4); __PYX_ERR(0, 191, __pyx_L3_error)
6362  }
6363  CYTHON_FALLTHROUGH;
6364  case 5:
6365  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
6366  else {
6367  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 5); __PYX_ERR(0, 191, __pyx_L3_error)
6368  }
6369  CYTHON_FALLTHROUGH;
6370  case 6:
6371  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dg_dof_offsets_subdomain_owned)) != 0)) kw_args--;
6372  else {
6373  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 6); __PYX_ERR(0, 191, __pyx_L3_error)
6374  }
6375  CYTHON_FALLTHROUGH;
6376  case 7:
6377  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dg_subdomain_l2g)) != 0)) kw_args--;
6378  else {
6379  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 7); __PYX_ERR(0, 191, __pyx_L3_error)
6380  }
6381  CYTHON_FALLTHROUGH;
6382  case 8:
6383  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dgNumbering_subdomain2global)) != 0)) kw_args--;
6384  else {
6385  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 8); __PYX_ERR(0, 191, __pyx_L3_error)
6386  }
6387  }
6388  if (unlikely(kw_args > 0)) {
6389  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildDiscontinuousGalerkinLocal2GlobalMappings") < 0)) __PYX_ERR(0, 191, __pyx_L3_error)
6390  }
6391  } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
6392  goto __pyx_L5_argtuple_error;
6393  } else {
6394  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6395  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6396  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6397  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6398  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6399  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6400  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6401  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6402  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6403  }
6404  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
6405  __pyx_v_nDOF_element = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nDOF_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L3_error)
6406  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
6407  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
6408  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
6409  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[5]);
6410  __pyx_v_dg_dof_offsets_subdomain_owned = ((PyArrayObject *)values[6]);
6411  __pyx_v_dg_subdomain_l2g = ((PyArrayObject *)values[7]);
6412  __pyx_v_dgNumbering_subdomain2global = ((PyArrayObject *)values[8]);
6413  }
6414  goto __pyx_L4_argument_unpacking_done;
6415  __pyx_L5_argtuple_error:;
6416  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 191, __pyx_L3_error)
6417  __pyx_L3_error:;
6418  __Pyx_AddTraceback("cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6419  __Pyx_RefNannyFinishContext();
6420  return NULL;
6421  __pyx_L4_argument_unpacking_done:;
6422  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 191, __pyx_L1_error)
6423  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 193, __pyx_L1_error)
6424  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 194, __pyx_L1_error)
6425  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 195, __pyx_L1_error)
6426  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 196, __pyx_L1_error)
6427  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "dg_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 197, __pyx_L1_error)
6428  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "dg_subdomain_l2g", 0))) __PYX_ERR(0, 198, __pyx_L1_error)
6429  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dgNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "dgNumbering_subdomain2global", 0))) __PYX_ERR(0, 199, __pyx_L1_error)
6430  __pyx_r = __pyx_pf_13cpartitioning_12buildDiscontinuousGalerkinLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nDOF_element, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_dg_dof_offsets_subdomain_owned, __pyx_v_dg_subdomain_l2g, __pyx_v_dgNumbering_subdomain2global);
6431 
6432  /* function exit code */
6433  goto __pyx_L0;
6434  __pyx_L1_error:;
6435  __pyx_r = NULL;
6436  __pyx_L0:;
6437  __Pyx_RefNannyFinishContext();
6438  return __pyx_r;
6439 }
6440 
6441 static PyObject *__pyx_pf_13cpartitioning_12buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nDOF_element, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global) {
6442  int __pyx_v_nDOF_all_processes;
6443  int __pyx_v_nDOF_subdomain;
6444  int __pyx_v_max_dof_neighbors;
6445  PyObject *__pyx_r = NULL;
6446  __Pyx_RefNannyDeclarations
6447  PyObject *__pyx_t_1 = NULL;
6448  PyObject *__pyx_t_2 = NULL;
6449  PyObject *__pyx_t_3 = NULL;
6450  PyObject *__pyx_t_4 = NULL;
6451  __Pyx_RefNannySetupContext("buildDiscontinuousGalerkinLocal2GlobalMappings", 0);
6452 
6453  /* "cpartitioning.pyx":200
6454  * np.ndarray dg_subdomain_l2g,
6455  * np.ndarray dgNumbering_subdomain2global):
6456  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
6457  * cdef int nDOF_subdomain=0
6458  * cdef int max_dof_neighbors=0
6459  */
6460  __pyx_v_nDOF_all_processes = 0;
6461 
6462  /* "cpartitioning.pyx":201
6463  * np.ndarray dgNumbering_subdomain2global):
6464  * cdef int nDOF_all_processes=0
6465  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
6466  * cdef int max_dof_neighbors=0
6467  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi,
6468  */
6469  __pyx_v_nDOF_subdomain = 0;
6470 
6471  /* "cpartitioning.pyx":202
6472  * cdef int nDOF_all_processes=0
6473  * cdef int nDOF_subdomain=0
6474  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
6475  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi,
6476  * cmesh.mesh,
6477  */
6478  __pyx_v_max_dof_neighbors = 0;
6479 
6480  /* "cpartitioning.pyx":203
6481  * cdef int nDOF_subdomain=0
6482  * cdef int max_dof_neighbors=0
6483  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi, # <<<<<<<<<<<<<<
6484  * cmesh.mesh,
6485  * <int*>(elementOffsets_subdomain_owned.data),
6486  */
6487  (void)(proteus::buildDiscontinuousGalerkinSubdomain2GlobalMappings(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementOffsets_subdomain_owned->data), ((int *)__pyx_v_elementNumbering_subdomain2global->data), __pyx_v_nDOF_element, __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_dg_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_dg_subdomain_l2g->data), ((int *)__pyx_v_dgNumbering_subdomain2global->data)));
6488 
6489  /* "cpartitioning.pyx":214
6490  * <int*>(dg_subdomain_l2g.data),
6491  * <int*>(dgNumbering_subdomain2global.data))
6492  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6493  * nDOF_subdomain,
6494  * max_dof_neighbors)
6495  */
6496  __Pyx_XDECREF(__pyx_r);
6497  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
6498  __Pyx_GOTREF(__pyx_t_1);
6499 
6500  /* "cpartitioning.pyx":215
6501  * <int*>(dgNumbering_subdomain2global.data))
6502  * return (nDOF_all_processes,
6503  * nDOF_subdomain, # <<<<<<<<<<<<<<
6504  * max_dof_neighbors)
6505  */
6506  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
6507  __Pyx_GOTREF(__pyx_t_2);
6508 
6509  /* "cpartitioning.pyx":216
6510  * return (nDOF_all_processes,
6511  * nDOF_subdomain,
6512  * max_dof_neighbors) # <<<<<<<<<<<<<<
6513  */
6514  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error)
6515  __Pyx_GOTREF(__pyx_t_3);
6516 
6517  /* "cpartitioning.pyx":214
6518  * <int*>(dg_subdomain_l2g.data),
6519  * <int*>(dgNumbering_subdomain2global.data))
6520  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6521  * nDOF_subdomain,
6522  * max_dof_neighbors)
6523  */
6524  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
6525  __Pyx_GOTREF(__pyx_t_4);
6526  __Pyx_GIVEREF(__pyx_t_1);
6527  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6528  __Pyx_GIVEREF(__pyx_t_2);
6529  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
6530  __Pyx_GIVEREF(__pyx_t_3);
6531  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6532  __pyx_t_1 = 0;
6533  __pyx_t_2 = 0;
6534  __pyx_t_3 = 0;
6535  __pyx_r = __pyx_t_4;
6536  __pyx_t_4 = 0;
6537  goto __pyx_L0;
6538 
6539  /* "cpartitioning.pyx":191
6540  * max_dof_neighbors)
6541  *
6542  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6543  * int nDOF_element,
6544  * cmeshTools.CMesh cmesh,
6545  */
6546 
6547  /* function exit code */
6548  __pyx_L1_error:;
6549  __Pyx_XDECREF(__pyx_t_1);
6550  __Pyx_XDECREF(__pyx_t_2);
6551  __Pyx_XDECREF(__pyx_t_3);
6552  __Pyx_XDECREF(__pyx_t_4);
6553  __Pyx_AddTraceback("cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6554  __pyx_r = NULL;
6555  __pyx_L0:;
6556  __Pyx_XGIVEREF(__pyx_r);
6557  __Pyx_RefNannyFinishContext();
6558  return __pyx_r;
6559 }
6560 
6561 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
6562  * # experimental exception made for __getbuffer__ and __releasebuffer__
6563  * # -- the details of this may change.
6564  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
6565  * # This implementation of getbuffer is geared towards Cython
6566  * # requirements, and does not yet fulfill the PEP.
6567  */
6568 
6569 /* Python wrapper */
6570 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
6571 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6572  int __pyx_r;
6573  __Pyx_RefNannyDeclarations
6574  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
6575  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
6576 
6577  /* function exit code */
6578  __Pyx_RefNannyFinishContext();
6579  return __pyx_r;
6580 }
6581 
6582 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6583  int __pyx_v_i;
6584  int __pyx_v_ndim;
6585  int __pyx_v_endian_detector;
6586  int __pyx_v_little_endian;
6587  int __pyx_v_t;
6588  char *__pyx_v_f;
6589  PyArray_Descr *__pyx_v_descr = 0;
6590  int __pyx_v_offset;
6591  int __pyx_r;
6592  __Pyx_RefNannyDeclarations
6593  int __pyx_t_1;
6594  int __pyx_t_2;
6595  PyObject *__pyx_t_3 = NULL;
6596  int __pyx_t_4;
6597  int __pyx_t_5;
6598  int __pyx_t_6;
6599  PyArray_Descr *__pyx_t_7;
6600  PyObject *__pyx_t_8 = NULL;
6601  char *__pyx_t_9;
6602  if (__pyx_v_info == NULL) {
6603  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6604  return -1;
6605  }
6606  __Pyx_RefNannySetupContext("__getbuffer__", 0);
6607  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6608  __Pyx_GIVEREF(__pyx_v_info->obj);
6609 
6610  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
6611  *
6612  * cdef int i, ndim
6613  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
6614  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6615  *
6616  */
6617  __pyx_v_endian_detector = 1;
6618 
6619  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
6620  * cdef int i, ndim
6621  * cdef int endian_detector = 1
6622  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
6623  *
6624  * ndim = PyArray_NDIM(self)
6625  */
6626  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
6627 
6628  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
6629  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6630  *
6631  * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
6632  *
6633  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6634  */
6635  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
6636 
6637  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6638  * ndim = PyArray_NDIM(self)
6639  *
6640  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6641  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6642  * raise ValueError(u"ndarray is not C contiguous")
6643  */
6644  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
6645  if (__pyx_t_2) {
6646  } else {
6647  __pyx_t_1 = __pyx_t_2;
6648  goto __pyx_L4_bool_binop_done;
6649  }
6650 
6651  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
6652  *
6653  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6654  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
6655  * raise ValueError(u"ndarray is not C contiguous")
6656  *
6657  */
6658  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
6659  __pyx_t_1 = __pyx_t_2;
6660  __pyx_L4_bool_binop_done:;
6661 
6662  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6663  * ndim = PyArray_NDIM(self)
6664  *
6665  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6666  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6667  * raise ValueError(u"ndarray is not C contiguous")
6668  */
6669  if (unlikely(__pyx_t_1)) {
6670 
6671  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
6672  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6673  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6674  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
6675  *
6676  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6677  */
6678  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 272, __pyx_L1_error)
6679  __Pyx_GOTREF(__pyx_t_3);
6680  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6681  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6682  __PYX_ERR(1, 272, __pyx_L1_error)
6683 
6684  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6685  * ndim = PyArray_NDIM(self)
6686  *
6687  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6688  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6689  * raise ValueError(u"ndarray is not C contiguous")
6690  */
6691  }
6692 
6693  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6694  * raise ValueError(u"ndarray is not C contiguous")
6695  *
6696  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6697  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6698  * raise ValueError(u"ndarray is not Fortran contiguous")
6699  */
6700  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
6701  if (__pyx_t_2) {
6702  } else {
6703  __pyx_t_1 = __pyx_t_2;
6704  goto __pyx_L7_bool_binop_done;
6705  }
6706 
6707  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
6708  *
6709  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6710  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
6711  * raise ValueError(u"ndarray is not Fortran contiguous")
6712  *
6713  */
6714  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
6715  __pyx_t_1 = __pyx_t_2;
6716  __pyx_L7_bool_binop_done:;
6717 
6718  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6719  * raise ValueError(u"ndarray is not C contiguous")
6720  *
6721  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6722  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6723  * raise ValueError(u"ndarray is not Fortran contiguous")
6724  */
6725  if (unlikely(__pyx_t_1)) {
6726 
6727  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
6728  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6729  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6730  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
6731  *
6732  * info.buf = PyArray_DATA(self)
6733  */
6734  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 276, __pyx_L1_error)
6735  __Pyx_GOTREF(__pyx_t_3);
6736  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6737  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6738  __PYX_ERR(1, 276, __pyx_L1_error)
6739 
6740  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6741  * raise ValueError(u"ndarray is not C contiguous")
6742  *
6743  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6744  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6745  * raise ValueError(u"ndarray is not Fortran contiguous")
6746  */
6747  }
6748 
6749  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
6750  * raise ValueError(u"ndarray is not Fortran contiguous")
6751  *
6752  * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
6753  * info.ndim = ndim
6754  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6755  */
6756  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
6757 
6758  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
6759  *
6760  * info.buf = PyArray_DATA(self)
6761  * info.ndim = ndim # <<<<<<<<<<<<<<
6762  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6763  * # Allocate new buffer for strides and shape info.
6764  */
6765  __pyx_v_info->ndim = __pyx_v_ndim;
6766 
6767  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
6768  * info.buf = PyArray_DATA(self)
6769  * info.ndim = ndim
6770  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6771  * # Allocate new buffer for strides and shape info.
6772  * # This is allocated as one block, strides first.
6773  */
6774  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
6775  if (__pyx_t_1) {
6776 
6777  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
6778  * # Allocate new buffer for strides and shape info.
6779  * # This is allocated as one block, strides first.
6780  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
6781  * info.shape = info.strides + ndim
6782  * for i in range(ndim):
6783  */
6784  __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
6785 
6786  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
6787  * # This is allocated as one block, strides first.
6788  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
6789  * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
6790  * for i in range(ndim):
6791  * info.strides[i] = PyArray_STRIDES(self)[i]
6792  */
6793  __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
6794 
6795  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
6796  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
6797  * info.shape = info.strides + ndim
6798  * for i in range(ndim): # <<<<<<<<<<<<<<
6799  * info.strides[i] = PyArray_STRIDES(self)[i]
6800  * info.shape[i] = PyArray_DIMS(self)[i]
6801  */
6802  __pyx_t_4 = __pyx_v_ndim;
6803  __pyx_t_5 = __pyx_t_4;
6804  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6805  __pyx_v_i = __pyx_t_6;
6806 
6807  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
6808  * info.shape = info.strides + ndim
6809  * for i in range(ndim):
6810  * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
6811  * info.shape[i] = PyArray_DIMS(self)[i]
6812  * else:
6813  */
6814  (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
6815 
6816  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
6817  * for i in range(ndim):
6818  * info.strides[i] = PyArray_STRIDES(self)[i]
6819  * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
6820  * else:
6821  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6822  */
6823  (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
6824  }
6825 
6826  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
6827  * info.buf = PyArray_DATA(self)
6828  * info.ndim = ndim
6829  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6830  * # Allocate new buffer for strides and shape info.
6831  * # This is allocated as one block, strides first.
6832  */
6833  goto __pyx_L9;
6834  }
6835 
6836  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
6837  * info.shape[i] = PyArray_DIMS(self)[i]
6838  * else:
6839  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
6840  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6841  * info.suboffsets = NULL
6842  */
6843  /*else*/ {
6844  __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
6845 
6846  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
6847  * else:
6848  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6849  * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
6850  * info.suboffsets = NULL
6851  * info.itemsize = PyArray_ITEMSIZE(self)
6852  */
6853  __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
6854  }
6855  __pyx_L9:;
6856 
6857  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
6858  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6859  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6860  * info.suboffsets = NULL # <<<<<<<<<<<<<<
6861  * info.itemsize = PyArray_ITEMSIZE(self)
6862  * info.readonly = not PyArray_ISWRITEABLE(self)
6863  */
6864  __pyx_v_info->suboffsets = NULL;
6865 
6866  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
6867  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6868  * info.suboffsets = NULL
6869  * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
6870  * info.readonly = not PyArray_ISWRITEABLE(self)
6871  *
6872  */
6873  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
6874 
6875  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
6876  * info.suboffsets = NULL
6877  * info.itemsize = PyArray_ITEMSIZE(self)
6878  * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
6879  *
6880  * cdef int t
6881  */
6882  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
6883 
6884  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
6885  *
6886  * cdef int t
6887  * cdef char* f = NULL # <<<<<<<<<<<<<<
6888  * cdef dtype descr = <dtype>PyArray_DESCR(self)
6889  * cdef int offset
6890  */
6891  __pyx_v_f = NULL;
6892 
6893  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
6894  * cdef int t
6895  * cdef char* f = NULL
6896  * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
6897  * cdef int offset
6898  *
6899  */
6900  __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
6901  __pyx_t_3 = ((PyObject *)__pyx_t_7);
6902  __Pyx_INCREF(__pyx_t_3);
6903  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
6904  __pyx_t_3 = 0;
6905 
6906  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":300
6907  * cdef int offset
6908  *
6909  * info.obj = self # <<<<<<<<<<<<<<
6910  *
6911  * if not PyDataType_HASFIELDS(descr):
6912  */
6913  __Pyx_INCREF(((PyObject *)__pyx_v_self));
6914  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6915  __Pyx_GOTREF(__pyx_v_info->obj);
6916  __Pyx_DECREF(__pyx_v_info->obj);
6917  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
6918 
6919  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
6920  * info.obj = self
6921  *
6922  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
6923  * t = descr.type_num
6924  * if ((descr.byteorder == c'>' and little_endian) or
6925  */
6926  __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
6927  if (__pyx_t_1) {
6928 
6929  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":303
6930  *
6931  * if not PyDataType_HASFIELDS(descr):
6932  * t = descr.type_num # <<<<<<<<<<<<<<
6933  * if ((descr.byteorder == c'>' and little_endian) or
6934  * (descr.byteorder == c'<' and not little_endian)):
6935  */
6936  __pyx_t_4 = __pyx_v_descr->type_num;
6937  __pyx_v_t = __pyx_t_4;
6938 
6939  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
6940  * if not PyDataType_HASFIELDS(descr):
6941  * t = descr.type_num
6942  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6943  * (descr.byteorder == c'<' and not little_endian)):
6944  * raise ValueError(u"Non-native byte order not supported")
6945  */
6946  __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
6947  if (!__pyx_t_2) {
6948  goto __pyx_L15_next_or;
6949  } else {
6950  }
6951  __pyx_t_2 = (__pyx_v_little_endian != 0);
6952  if (!__pyx_t_2) {
6953  } else {
6954  __pyx_t_1 = __pyx_t_2;
6955  goto __pyx_L14_bool_binop_done;
6956  }
6957  __pyx_L15_next_or:;
6958 
6959  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":305
6960  * t = descr.type_num
6961  * if ((descr.byteorder == c'>' and little_endian) or
6962  * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
6963  * raise ValueError(u"Non-native byte order not supported")
6964  * if t == NPY_BYTE: f = "b"
6965  */
6966  __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
6967  if (__pyx_t_2) {
6968  } else {
6969  __pyx_t_1 = __pyx_t_2;
6970  goto __pyx_L14_bool_binop_done;
6971  }
6972  __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
6973  __pyx_t_1 = __pyx_t_2;
6974  __pyx_L14_bool_binop_done:;
6975 
6976  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
6977  * if not PyDataType_HASFIELDS(descr):
6978  * t = descr.type_num
6979  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6980  * (descr.byteorder == c'<' and not little_endian)):
6981  * raise ValueError(u"Non-native byte order not supported")
6982  */
6983  if (unlikely(__pyx_t_1)) {
6984 
6985  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
6986  * if ((descr.byteorder == c'>' and little_endian) or
6987  * (descr.byteorder == c'<' and not little_endian)):
6988  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6989  * if t == NPY_BYTE: f = "b"
6990  * elif t == NPY_UBYTE: f = "B"
6991  */
6992  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 306, __pyx_L1_error)
6993  __Pyx_GOTREF(__pyx_t_3);
6994  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6995  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6996  __PYX_ERR(1, 306, __pyx_L1_error)
6997 
6998  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
6999  * if not PyDataType_HASFIELDS(descr):
7000  * t = descr.type_num
7001  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7002  * (descr.byteorder == c'<' and not little_endian)):
7003  * raise ValueError(u"Non-native byte order not supported")
7004  */
7005  }
7006 
7007  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":307
7008  * (descr.byteorder == c'<' and not little_endian)):
7009  * raise ValueError(u"Non-native byte order not supported")
7010  * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
7011  * elif t == NPY_UBYTE: f = "B"
7012  * elif t == NPY_SHORT: f = "h"
7013  */
7014  switch (__pyx_v_t) {
7015  case NPY_BYTE:
7016  __pyx_v_f = ((char *)"b");
7017  break;
7018  case NPY_UBYTE:
7019 
7020  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":308
7021  * raise ValueError(u"Non-native byte order not supported")
7022  * if t == NPY_BYTE: f = "b"
7023  * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
7024  * elif t == NPY_SHORT: f = "h"
7025  * elif t == NPY_USHORT: f = "H"
7026  */
7027  __pyx_v_f = ((char *)"B");
7028  break;
7029  case NPY_SHORT:
7030 
7031  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":309
7032  * if t == NPY_BYTE: f = "b"
7033  * elif t == NPY_UBYTE: f = "B"
7034  * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
7035  * elif t == NPY_USHORT: f = "H"
7036  * elif t == NPY_INT: f = "i"
7037  */
7038  __pyx_v_f = ((char *)"h");
7039  break;
7040  case NPY_USHORT:
7041 
7042  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":310
7043  * elif t == NPY_UBYTE: f = "B"
7044  * elif t == NPY_SHORT: f = "h"
7045  * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
7046  * elif t == NPY_INT: f = "i"
7047  * elif t == NPY_UINT: f = "I"
7048  */
7049  __pyx_v_f = ((char *)"H");
7050  break;
7051  case NPY_INT:
7052 
7053  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":311
7054  * elif t == NPY_SHORT: f = "h"
7055  * elif t == NPY_USHORT: f = "H"
7056  * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
7057  * elif t == NPY_UINT: f = "I"
7058  * elif t == NPY_LONG: f = "l"
7059  */
7060  __pyx_v_f = ((char *)"i");
7061  break;
7062  case NPY_UINT:
7063 
7064  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":312
7065  * elif t == NPY_USHORT: f = "H"
7066  * elif t == NPY_INT: f = "i"
7067  * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
7068  * elif t == NPY_LONG: f = "l"
7069  * elif t == NPY_ULONG: f = "L"
7070  */
7071  __pyx_v_f = ((char *)"I");
7072  break;
7073  case NPY_LONG:
7074 
7075  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":313
7076  * elif t == NPY_INT: f = "i"
7077  * elif t == NPY_UINT: f = "I"
7078  * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
7079  * elif t == NPY_ULONG: f = "L"
7080  * elif t == NPY_LONGLONG: f = "q"
7081  */
7082  __pyx_v_f = ((char *)"l");
7083  break;
7084  case NPY_ULONG:
7085 
7086  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":314
7087  * elif t == NPY_UINT: f = "I"
7088  * elif t == NPY_LONG: f = "l"
7089  * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
7090  * elif t == NPY_LONGLONG: f = "q"
7091  * elif t == NPY_ULONGLONG: f = "Q"
7092  */
7093  __pyx_v_f = ((char *)"L");
7094  break;
7095  case NPY_LONGLONG:
7096 
7097  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":315
7098  * elif t == NPY_LONG: f = "l"
7099  * elif t == NPY_ULONG: f = "L"
7100  * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
7101  * elif t == NPY_ULONGLONG: f = "Q"
7102  * elif t == NPY_FLOAT: f = "f"
7103  */
7104  __pyx_v_f = ((char *)"q");
7105  break;
7106  case NPY_ULONGLONG:
7107 
7108  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":316
7109  * elif t == NPY_ULONG: f = "L"
7110  * elif t == NPY_LONGLONG: f = "q"
7111  * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
7112  * elif t == NPY_FLOAT: f = "f"
7113  * elif t == NPY_DOUBLE: f = "d"
7114  */
7115  __pyx_v_f = ((char *)"Q");
7116  break;
7117  case NPY_FLOAT:
7118 
7119  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":317
7120  * elif t == NPY_LONGLONG: f = "q"
7121  * elif t == NPY_ULONGLONG: f = "Q"
7122  * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
7123  * elif t == NPY_DOUBLE: f = "d"
7124  * elif t == NPY_LONGDOUBLE: f = "g"
7125  */
7126  __pyx_v_f = ((char *)"f");
7127  break;
7128  case NPY_DOUBLE:
7129 
7130  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":318
7131  * elif t == NPY_ULONGLONG: f = "Q"
7132  * elif t == NPY_FLOAT: f = "f"
7133  * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
7134  * elif t == NPY_LONGDOUBLE: f = "g"
7135  * elif t == NPY_CFLOAT: f = "Zf"
7136  */
7137  __pyx_v_f = ((char *)"d");
7138  break;
7139  case NPY_LONGDOUBLE:
7140 
7141  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":319
7142  * elif t == NPY_FLOAT: f = "f"
7143  * elif t == NPY_DOUBLE: f = "d"
7144  * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
7145  * elif t == NPY_CFLOAT: f = "Zf"
7146  * elif t == NPY_CDOUBLE: f = "Zd"
7147  */
7148  __pyx_v_f = ((char *)"g");
7149  break;
7150  case NPY_CFLOAT:
7151 
7152  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":320
7153  * elif t == NPY_DOUBLE: f = "d"
7154  * elif t == NPY_LONGDOUBLE: f = "g"
7155  * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
7156  * elif t == NPY_CDOUBLE: f = "Zd"
7157  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7158  */
7159  __pyx_v_f = ((char *)"Zf");
7160  break;
7161  case NPY_CDOUBLE:
7162 
7163  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":321
7164  * elif t == NPY_LONGDOUBLE: f = "g"
7165  * elif t == NPY_CFLOAT: f = "Zf"
7166  * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
7167  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7168  * elif t == NPY_OBJECT: f = "O"
7169  */
7170  __pyx_v_f = ((char *)"Zd");
7171  break;
7172  case NPY_CLONGDOUBLE:
7173 
7174  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":322
7175  * elif t == NPY_CFLOAT: f = "Zf"
7176  * elif t == NPY_CDOUBLE: f = "Zd"
7177  * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
7178  * elif t == NPY_OBJECT: f = "O"
7179  * else:
7180  */
7181  __pyx_v_f = ((char *)"Zg");
7182  break;
7183  case NPY_OBJECT:
7184 
7185  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":323
7186  * elif t == NPY_CDOUBLE: f = "Zd"
7187  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7188  * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
7189  * else:
7190  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7191  */
7192  __pyx_v_f = ((char *)"O");
7193  break;
7194  default:
7195 
7196  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":325
7197  * elif t == NPY_OBJECT: f = "O"
7198  * else:
7199  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7200  * info.format = f
7201  * return
7202  */
7203  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
7204  __Pyx_GOTREF(__pyx_t_3);
7205  __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 325, __pyx_L1_error)
7206  __Pyx_GOTREF(__pyx_t_8);
7207  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7208  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
7209  __Pyx_GOTREF(__pyx_t_3);
7210  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7211  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7212  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7213  __PYX_ERR(1, 325, __pyx_L1_error)
7214  break;
7215  }
7216 
7217  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":326
7218  * else:
7219  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7220  * info.format = f # <<<<<<<<<<<<<<
7221  * return
7222  * else:
7223  */
7224  __pyx_v_info->format = __pyx_v_f;
7225 
7226  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":327
7227  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7228  * info.format = f
7229  * return # <<<<<<<<<<<<<<
7230  * else:
7231  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7232  */
7233  __pyx_r = 0;
7234  goto __pyx_L0;
7235 
7236  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
7237  * info.obj = self
7238  *
7239  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
7240  * t = descr.type_num
7241  * if ((descr.byteorder == c'>' and little_endian) or
7242  */
7243  }
7244 
7245  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":329
7246  * return
7247  * else:
7248  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
7249  * info.format[0] = c'^' # Native data types, manual alignment
7250  * offset = 0
7251  */
7252  /*else*/ {
7253  __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
7254 
7255  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":330
7256  * else:
7257  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7258  * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
7259  * offset = 0
7260  * f = _util_dtypestring(descr, info.format + 1,
7261  */
7262  (__pyx_v_info->format[0]) = '^';
7263 
7264  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":331
7265  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7266  * info.format[0] = c'^' # Native data types, manual alignment
7267  * offset = 0 # <<<<<<<<<<<<<<
7268  * f = _util_dtypestring(descr, info.format + 1,
7269  * info.format + _buffer_format_string_len,
7270  */
7271  __pyx_v_offset = 0;
7272 
7273  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":332
7274  * info.format[0] = c'^' # Native data types, manual alignment
7275  * offset = 0
7276  * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
7277  * info.format + _buffer_format_string_len,
7278  * &offset)
7279  */
7280  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 332, __pyx_L1_error)
7281  __pyx_v_f = __pyx_t_9;
7282 
7283  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":335
7284  * info.format + _buffer_format_string_len,
7285  * &offset)
7286  * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
7287  *
7288  * def __releasebuffer__(ndarray self, Py_buffer* info):
7289  */
7290  (__pyx_v_f[0]) = '\x00';
7291  }
7292 
7293  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
7294  * # experimental exception made for __getbuffer__ and __releasebuffer__
7295  * # -- the details of this may change.
7296  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
7297  * # This implementation of getbuffer is geared towards Cython
7298  * # requirements, and does not yet fulfill the PEP.
7299  */
7300 
7301  /* function exit code */
7302  __pyx_r = 0;
7303  goto __pyx_L0;
7304  __pyx_L1_error:;
7305  __Pyx_XDECREF(__pyx_t_3);
7306  __Pyx_XDECREF(__pyx_t_8);
7307  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7308  __pyx_r = -1;
7309  if (__pyx_v_info->obj != NULL) {
7310  __Pyx_GOTREF(__pyx_v_info->obj);
7311  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7312  }
7313  goto __pyx_L2;
7314  __pyx_L0:;
7315  if (__pyx_v_info->obj == Py_None) {
7316  __Pyx_GOTREF(__pyx_v_info->obj);
7317  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7318  }
7319  __pyx_L2:;
7320  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
7321  __Pyx_RefNannyFinishContext();
7322  return __pyx_r;
7323 }
7324 
7325 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
7326  * f[0] = c'\0' # Terminate format string
7327  *
7328  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
7329  * if PyArray_HASFIELDS(self):
7330  * PyObject_Free(info.format)
7331  */
7332 
7333 /* Python wrapper */
7334 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
7335 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7336  __Pyx_RefNannyDeclarations
7337  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
7338  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
7339 
7340  /* function exit code */
7341  __Pyx_RefNannyFinishContext();
7342 }
7343 
7344 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7345  __Pyx_RefNannyDeclarations
7346  int __pyx_t_1;
7347  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
7348 
7349  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
7350  *
7351  * def __releasebuffer__(ndarray self, Py_buffer* info):
7352  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
7353  * PyObject_Free(info.format)
7354  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7355  */
7356  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
7357  if (__pyx_t_1) {
7358 
7359  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":339
7360  * def __releasebuffer__(ndarray self, Py_buffer* info):
7361  * if PyArray_HASFIELDS(self):
7362  * PyObject_Free(info.format) # <<<<<<<<<<<<<<
7363  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7364  * PyObject_Free(info.strides)
7365  */
7366  PyObject_Free(__pyx_v_info->format);
7367 
7368  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
7369  *
7370  * def __releasebuffer__(ndarray self, Py_buffer* info):
7371  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
7372  * PyObject_Free(info.format)
7373  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7374  */
7375  }
7376 
7377  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
7378  * if PyArray_HASFIELDS(self):
7379  * PyObject_Free(info.format)
7380  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7381  * PyObject_Free(info.strides)
7382  * # info.shape was stored after info.strides in the same block
7383  */
7384  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
7385  if (__pyx_t_1) {
7386 
7387  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":341
7388  * PyObject_Free(info.format)
7389  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7390  * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
7391  * # info.shape was stored after info.strides in the same block
7392  *
7393  */
7394  PyObject_Free(__pyx_v_info->strides);
7395 
7396  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
7397  * if PyArray_HASFIELDS(self):
7398  * PyObject_Free(info.format)
7399  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7400  * PyObject_Free(info.strides)
7401  * # info.shape was stored after info.strides in the same block
7402  */
7403  }
7404 
7405  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
7406  * f[0] = c'\0' # Terminate format string
7407  *
7408  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
7409  * if PyArray_HASFIELDS(self):
7410  * PyObject_Free(info.format)
7411  */
7412 
7413  /* function exit code */
7414  __Pyx_RefNannyFinishContext();
7415 }
7416 
7417 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
7418  * ctypedef npy_cdouble complex_t
7419  *
7420  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7421  * return PyArray_MultiIterNew(1, <void*>a)
7422  *
7423  */
7424 
7425 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7426  PyObject *__pyx_r = NULL;
7427  __Pyx_RefNannyDeclarations
7428  PyObject *__pyx_t_1 = NULL;
7429  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
7430 
7431  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
7432  *
7433  * cdef inline object PyArray_MultiIterNew1(a):
7434  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
7435  *
7436  * cdef inline object PyArray_MultiIterNew2(a, b):
7437  */
7438  __Pyx_XDECREF(__pyx_r);
7439  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 822, __pyx_L1_error)
7440  __Pyx_GOTREF(__pyx_t_1);
7441  __pyx_r = __pyx_t_1;
7442  __pyx_t_1 = 0;
7443  goto __pyx_L0;
7444 
7445  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
7446  * ctypedef npy_cdouble complex_t
7447  *
7448  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7449  * return PyArray_MultiIterNew(1, <void*>a)
7450  *
7451  */
7452 
7453  /* function exit code */
7454  __pyx_L1_error:;
7455  __Pyx_XDECREF(__pyx_t_1);
7456  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7457  __pyx_r = 0;
7458  __pyx_L0:;
7459  __Pyx_XGIVEREF(__pyx_r);
7460  __Pyx_RefNannyFinishContext();
7461  return __pyx_r;
7462 }
7463 
7464 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
7465  * return PyArray_MultiIterNew(1, <void*>a)
7466  *
7467  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7468  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7469  *
7470  */
7471 
7472 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7473  PyObject *__pyx_r = NULL;
7474  __Pyx_RefNannyDeclarations
7475  PyObject *__pyx_t_1 = NULL;
7476  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
7477 
7478  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
7479  *
7480  * cdef inline object PyArray_MultiIterNew2(a, b):
7481  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
7482  *
7483  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7484  */
7485  __Pyx_XDECREF(__pyx_r);
7486  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 825, __pyx_L1_error)
7487  __Pyx_GOTREF(__pyx_t_1);
7488  __pyx_r = __pyx_t_1;
7489  __pyx_t_1 = 0;
7490  goto __pyx_L0;
7491 
7492  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
7493  * return PyArray_MultiIterNew(1, <void*>a)
7494  *
7495  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7496  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7497  *
7498  */
7499 
7500  /* function exit code */
7501  __pyx_L1_error:;
7502  __Pyx_XDECREF(__pyx_t_1);
7503  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7504  __pyx_r = 0;
7505  __pyx_L0:;
7506  __Pyx_XGIVEREF(__pyx_r);
7507  __Pyx_RefNannyFinishContext();
7508  return __pyx_r;
7509 }
7510 
7511 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
7512  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7513  *
7514  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7515  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7516  *
7517  */
7518 
7519 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7520  PyObject *__pyx_r = NULL;
7521  __Pyx_RefNannyDeclarations
7522  PyObject *__pyx_t_1 = NULL;
7523  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
7524 
7525  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
7526  *
7527  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7528  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
7529  *
7530  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7531  */
7532  __Pyx_XDECREF(__pyx_r);
7533  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 828, __pyx_L1_error)
7534  __Pyx_GOTREF(__pyx_t_1);
7535  __pyx_r = __pyx_t_1;
7536  __pyx_t_1 = 0;
7537  goto __pyx_L0;
7538 
7539  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
7540  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7541  *
7542  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7543  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7544  *
7545  */
7546 
7547  /* function exit code */
7548  __pyx_L1_error:;
7549  __Pyx_XDECREF(__pyx_t_1);
7550  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7551  __pyx_r = 0;
7552  __pyx_L0:;
7553  __Pyx_XGIVEREF(__pyx_r);
7554  __Pyx_RefNannyFinishContext();
7555  return __pyx_r;
7556 }
7557 
7558 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
7559  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7560  *
7561  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7562  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7563  *
7564  */
7565 
7566 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7567  PyObject *__pyx_r = NULL;
7568  __Pyx_RefNannyDeclarations
7569  PyObject *__pyx_t_1 = NULL;
7570  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
7571 
7572  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
7573  *
7574  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7575  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
7576  *
7577  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7578  */
7579  __Pyx_XDECREF(__pyx_r);
7580  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 831, __pyx_L1_error)
7581  __Pyx_GOTREF(__pyx_t_1);
7582  __pyx_r = __pyx_t_1;
7583  __pyx_t_1 = 0;
7584  goto __pyx_L0;
7585 
7586  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
7587  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7588  *
7589  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7590  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7591  *
7592  */
7593 
7594  /* function exit code */
7595  __pyx_L1_error:;
7596  __Pyx_XDECREF(__pyx_t_1);
7597  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7598  __pyx_r = 0;
7599  __pyx_L0:;
7600  __Pyx_XGIVEREF(__pyx_r);
7601  __Pyx_RefNannyFinishContext();
7602  return __pyx_r;
7603 }
7604 
7605 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7606  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7607  *
7608  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7609  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7610  *
7611  */
7612 
7613 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7614  PyObject *__pyx_r = NULL;
7615  __Pyx_RefNannyDeclarations
7616  PyObject *__pyx_t_1 = NULL;
7617  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7618 
7619  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
7620  *
7621  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7622  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
7623  *
7624  * cdef inline tuple PyDataType_SHAPE(dtype d):
7625  */
7626  __Pyx_XDECREF(__pyx_r);
7627  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 834, __pyx_L1_error)
7628  __Pyx_GOTREF(__pyx_t_1);
7629  __pyx_r = __pyx_t_1;
7630  __pyx_t_1 = 0;
7631  goto __pyx_L0;
7632 
7633  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7634  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7635  *
7636  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7637  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7638  *
7639  */
7640 
7641  /* function exit code */
7642  __pyx_L1_error:;
7643  __Pyx_XDECREF(__pyx_t_1);
7644  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7645  __pyx_r = 0;
7646  __pyx_L0:;
7647  __Pyx_XGIVEREF(__pyx_r);
7648  __Pyx_RefNannyFinishContext();
7649  return __pyx_r;
7650 }
7651 
7652 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
7653  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7654  *
7655  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7656  * if PyDataType_HASSUBARRAY(d):
7657  * return <tuple>d.subarray.shape
7658  */
7659 
7660 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7661  PyObject *__pyx_r = NULL;
7662  __Pyx_RefNannyDeclarations
7663  int __pyx_t_1;
7664  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7665 
7666  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
7667  *
7668  * cdef inline tuple PyDataType_SHAPE(dtype d):
7669  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7670  * return <tuple>d.subarray.shape
7671  * else:
7672  */
7673  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7674  if (__pyx_t_1) {
7675 
7676  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
7677  * cdef inline tuple PyDataType_SHAPE(dtype d):
7678  * if PyDataType_HASSUBARRAY(d):
7679  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
7680  * else:
7681  * return ()
7682  */
7683  __Pyx_XDECREF(__pyx_r);
7684  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7685  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7686  goto __pyx_L0;
7687 
7688  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
7689  *
7690  * cdef inline tuple PyDataType_SHAPE(dtype d):
7691  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7692  * return <tuple>d.subarray.shape
7693  * else:
7694  */
7695  }
7696 
7697  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
7698  * return <tuple>d.subarray.shape
7699  * else:
7700  * return () # <<<<<<<<<<<<<<
7701  *
7702  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
7703  */
7704  /*else*/ {
7705  __Pyx_XDECREF(__pyx_r);
7706  __Pyx_INCREF(__pyx_empty_tuple);
7707  __pyx_r = __pyx_empty_tuple;
7708  goto __pyx_L0;
7709  }
7710 
7711  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
7712  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7713  *
7714  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7715  * if PyDataType_HASSUBARRAY(d):
7716  * return <tuple>d.subarray.shape
7717  */
7718 
7719  /* function exit code */
7720  __pyx_L0:;
7721  __Pyx_XGIVEREF(__pyx_r);
7722  __Pyx_RefNannyFinishContext();
7723  return __pyx_r;
7724 }
7725 
7726 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
7727  * return ()
7728  *
7729  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7730  * # Recursive utility function used in __getbuffer__ to get format
7731  * # string. The new location in the format string is returned.
7732  */
7733 
7734 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
7735  PyArray_Descr *__pyx_v_child = 0;
7736  int __pyx_v_endian_detector;
7737  int __pyx_v_little_endian;
7738  PyObject *__pyx_v_fields = 0;
7739  PyObject *__pyx_v_childname = NULL;
7740  PyObject *__pyx_v_new_offset = NULL;
7741  PyObject *__pyx_v_t = NULL;
7742  char *__pyx_r;
7743  __Pyx_RefNannyDeclarations
7744  PyObject *__pyx_t_1 = NULL;
7745  Py_ssize_t __pyx_t_2;
7746  PyObject *__pyx_t_3 = NULL;
7747  PyObject *__pyx_t_4 = NULL;
7748  int __pyx_t_5;
7749  int __pyx_t_6;
7750  int __pyx_t_7;
7751  long __pyx_t_8;
7752  char *__pyx_t_9;
7753  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
7754 
7755  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
7756  *
7757  * cdef dtype child
7758  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
7759  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
7760  * cdef tuple fields
7761  */
7762  __pyx_v_endian_detector = 1;
7763 
7764  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
7765  * cdef dtype child
7766  * cdef int endian_detector = 1
7767  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
7768  * cdef tuple fields
7769  *
7770  */
7771  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
7772 
7773  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
7774  * cdef tuple fields
7775  *
7776  * for childname in descr.names: # <<<<<<<<<<<<<<
7777  * fields = descr.fields[childname]
7778  * child, new_offset = fields
7779  */
7780  if (unlikely(__pyx_v_descr->names == Py_None)) {
7781  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
7782  __PYX_ERR(1, 851, __pyx_L1_error)
7783  }
7784  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7785  for (;;) {
7786  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
7787  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7788  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 851, __pyx_L1_error)
7789  #else
7790  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error)
7791  __Pyx_GOTREF(__pyx_t_3);
7792  #endif
7793  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
7794  __pyx_t_3 = 0;
7795 
7796  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
7797  *
7798  * for childname in descr.names:
7799  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
7800  * child, new_offset = fields
7801  *
7802  */
7803  if (unlikely(__pyx_v_descr->fields == Py_None)) {
7804  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7805  __PYX_ERR(1, 852, __pyx_L1_error)
7806  }
7807  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error)
7808  __Pyx_GOTREF(__pyx_t_3);
7809  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 852, __pyx_L1_error)
7810  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
7811  __pyx_t_3 = 0;
7812 
7813  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
7814  * for childname in descr.names:
7815  * fields = descr.fields[childname]
7816  * child, new_offset = fields # <<<<<<<<<<<<<<
7817  *
7818  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7819  */
7820  if (likely(__pyx_v_fields != Py_None)) {
7821  PyObject* sequence = __pyx_v_fields;
7822  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7823  if (unlikely(size != 2)) {
7824  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7825  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7826  __PYX_ERR(1, 853, __pyx_L1_error)
7827  }
7828  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7829  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7830  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
7831  __Pyx_INCREF(__pyx_t_3);
7832  __Pyx_INCREF(__pyx_t_4);
7833  #else
7834  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error)
7835  __Pyx_GOTREF(__pyx_t_3);
7836  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error)
7837  __Pyx_GOTREF(__pyx_t_4);
7838  #endif
7839  } else {
7840  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 853, __pyx_L1_error)
7841  }
7842  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 853, __pyx_L1_error)
7843  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
7844  __pyx_t_3 = 0;
7845  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
7846  __pyx_t_4 = 0;
7847 
7848  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
7849  * child, new_offset = fields
7850  *
7851  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7852  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7853  *
7854  */
7855  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error)
7856  __Pyx_GOTREF(__pyx_t_4);
7857  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error)
7858  __Pyx_GOTREF(__pyx_t_3);
7859  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7860  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 855, __pyx_L1_error)
7861  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7862  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
7863  if (unlikely(__pyx_t_6)) {
7864 
7865  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
7866  *
7867  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7868  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
7869  *
7870  * if ((child.byteorder == c'>' and little_endian) or
7871  */
7872  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 856, __pyx_L1_error)
7873  __Pyx_GOTREF(__pyx_t_3);
7874  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7875  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7876  __PYX_ERR(1, 856, __pyx_L1_error)
7877 
7878  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
7879  * child, new_offset = fields
7880  *
7881  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7882  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7883  *
7884  */
7885  }
7886 
7887  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
7888  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7889  *
7890  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7891  * (child.byteorder == c'<' and not little_endian)):
7892  * raise ValueError(u"Non-native byte order not supported")
7893  */
7894  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
7895  if (!__pyx_t_7) {
7896  goto __pyx_L8_next_or;
7897  } else {
7898  }
7899  __pyx_t_7 = (__pyx_v_little_endian != 0);
7900  if (!__pyx_t_7) {
7901  } else {
7902  __pyx_t_6 = __pyx_t_7;
7903  goto __pyx_L7_bool_binop_done;
7904  }
7905  __pyx_L8_next_or:;
7906 
7907  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":859
7908  *
7909  * if ((child.byteorder == c'>' and little_endian) or
7910  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
7911  * raise ValueError(u"Non-native byte order not supported")
7912  * # One could encode it in the format string and have Cython
7913  */
7914  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
7915  if (__pyx_t_7) {
7916  } else {
7917  __pyx_t_6 = __pyx_t_7;
7918  goto __pyx_L7_bool_binop_done;
7919  }
7920  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7921  __pyx_t_6 = __pyx_t_7;
7922  __pyx_L7_bool_binop_done:;
7923 
7924  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
7925  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7926  *
7927  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7928  * (child.byteorder == c'<' and not little_endian)):
7929  * raise ValueError(u"Non-native byte order not supported")
7930  */
7931  if (unlikely(__pyx_t_6)) {
7932 
7933  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":860
7934  * if ((child.byteorder == c'>' and little_endian) or
7935  * (child.byteorder == c'<' and not little_endian)):
7936  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
7937  * # One could encode it in the format string and have Cython
7938  * # complain instead, BUT: < and > in format strings also imply
7939  */
7940  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error)
7941  __Pyx_GOTREF(__pyx_t_3);
7942  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7943  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7944  __PYX_ERR(1, 860, __pyx_L1_error)
7945 
7946  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
7947  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7948  *
7949  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7950  * (child.byteorder == c'<' and not little_endian)):
7951  * raise ValueError(u"Non-native byte order not supported")
7952  */
7953  }
7954 
7955  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":870
7956  *
7957  * # Output padding bytes
7958  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
7959  * f[0] = 120 # "x"; pad byte
7960  * f += 1
7961  */
7962  while (1) {
7963  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 870, __pyx_L1_error)
7964  __Pyx_GOTREF(__pyx_t_3);
7965  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 870, __pyx_L1_error)
7966  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7967  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 870, __pyx_L1_error)
7968  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7969  if (!__pyx_t_6) break;
7970 
7971  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":871
7972  * # Output padding bytes
7973  * while offset[0] < new_offset:
7974  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
7975  * f += 1
7976  * offset[0] += 1
7977  */
7978  (__pyx_v_f[0]) = 0x78;
7979 
7980  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":872
7981  * while offset[0] < new_offset:
7982  * f[0] = 120 # "x"; pad byte
7983  * f += 1 # <<<<<<<<<<<<<<
7984  * offset[0] += 1
7985  *
7986  */
7987  __pyx_v_f = (__pyx_v_f + 1);
7988 
7989  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":873
7990  * f[0] = 120 # "x"; pad byte
7991  * f += 1
7992  * offset[0] += 1 # <<<<<<<<<<<<<<
7993  *
7994  * offset[0] += child.itemsize
7995  */
7996  __pyx_t_8 = 0;
7997  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7998  }
7999 
8000  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":875
8001  * offset[0] += 1
8002  *
8003  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
8004  *
8005  * if not PyDataType_HASFIELDS(child):
8006  */
8007  __pyx_t_8 = 0;
8008  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
8009 
8010  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
8011  * offset[0] += child.itemsize
8012  *
8013  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
8014  * t = child.type_num
8015  * if end - f < 5:
8016  */
8017  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
8018  if (__pyx_t_6) {
8019 
8020  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":878
8021  *
8022  * if not PyDataType_HASFIELDS(child):
8023  * t = child.type_num # <<<<<<<<<<<<<<
8024  * if end - f < 5:
8025  * raise RuntimeError(u"Format string allocated too short.")
8026  */
8027  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 878, __pyx_L1_error)
8028  __Pyx_GOTREF(__pyx_t_4);
8029  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
8030  __pyx_t_4 = 0;
8031 
8032  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
8033  * if not PyDataType_HASFIELDS(child):
8034  * t = child.type_num
8035  * if end - f < 5: # <<<<<<<<<<<<<<
8036  * raise RuntimeError(u"Format string allocated too short.")
8037  *
8038  */
8039  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
8040  if (unlikely(__pyx_t_6)) {
8041 
8042  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
8043  * t = child.type_num
8044  * if end - f < 5:
8045  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
8046  *
8047  * # Until ticket #99 is fixed, use integers to avoid warnings
8048  */
8049  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 880, __pyx_L1_error)
8050  __Pyx_GOTREF(__pyx_t_4);
8051  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8052  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8053  __PYX_ERR(1, 880, __pyx_L1_error)
8054 
8055  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
8056  * if not PyDataType_HASFIELDS(child):
8057  * t = child.type_num
8058  * if end - f < 5: # <<<<<<<<<<<<<<
8059  * raise RuntimeError(u"Format string allocated too short.")
8060  *
8061  */
8062  }
8063 
8064  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":883
8065  *
8066  * # Until ticket #99 is fixed, use integers to avoid warnings
8067  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
8068  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8069  * elif t == NPY_SHORT: f[0] = 104 #"h"
8070  */
8071  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error)
8072  __Pyx_GOTREF(__pyx_t_4);
8073  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 883, __pyx_L1_error)
8074  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8075  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 883, __pyx_L1_error)
8076  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8077  if (__pyx_t_6) {
8078  (__pyx_v_f[0]) = 98;
8079  goto __pyx_L15;
8080  }
8081 
8082  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":884
8083  * # Until ticket #99 is fixed, use integers to avoid warnings
8084  * if t == NPY_BYTE: f[0] = 98 #"b"
8085  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
8086  * elif t == NPY_SHORT: f[0] = 104 #"h"
8087  * elif t == NPY_USHORT: f[0] = 72 #"H"
8088  */
8089  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 884, __pyx_L1_error)
8090  __Pyx_GOTREF(__pyx_t_3);
8091  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 884, __pyx_L1_error)
8092  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8093  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 884, __pyx_L1_error)
8094  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8095  if (__pyx_t_6) {
8096  (__pyx_v_f[0]) = 66;
8097  goto __pyx_L15;
8098  }
8099 
8100  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":885
8101  * if t == NPY_BYTE: f[0] = 98 #"b"
8102  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8103  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
8104  * elif t == NPY_USHORT: f[0] = 72 #"H"
8105  * elif t == NPY_INT: f[0] = 105 #"i"
8106  */
8107  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error)
8108  __Pyx_GOTREF(__pyx_t_4);
8109  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 885, __pyx_L1_error)
8110  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8111  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 885, __pyx_L1_error)
8112  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8113  if (__pyx_t_6) {
8114  (__pyx_v_f[0]) = 0x68;
8115  goto __pyx_L15;
8116  }
8117 
8118  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":886
8119  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8120  * elif t == NPY_SHORT: f[0] = 104 #"h"
8121  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
8122  * elif t == NPY_INT: f[0] = 105 #"i"
8123  * elif t == NPY_UINT: f[0] = 73 #"I"
8124  */
8125  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error)
8126  __Pyx_GOTREF(__pyx_t_3);
8127  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error)
8128  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8129  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error)
8130  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8131  if (__pyx_t_6) {
8132  (__pyx_v_f[0]) = 72;
8133  goto __pyx_L15;
8134  }
8135 
8136  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":887
8137  * elif t == NPY_SHORT: f[0] = 104 #"h"
8138  * elif t == NPY_USHORT: f[0] = 72 #"H"
8139  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
8140  * elif t == NPY_UINT: f[0] = 73 #"I"
8141  * elif t == NPY_LONG: f[0] = 108 #"l"
8142  */
8143  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 887, __pyx_L1_error)
8144  __Pyx_GOTREF(__pyx_t_4);
8145  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 887, __pyx_L1_error)
8146  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8147  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 887, __pyx_L1_error)
8148  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8149  if (__pyx_t_6) {
8150  (__pyx_v_f[0]) = 0x69;
8151  goto __pyx_L15;
8152  }
8153 
8154  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":888
8155  * elif t == NPY_USHORT: f[0] = 72 #"H"
8156  * elif t == NPY_INT: f[0] = 105 #"i"
8157  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
8158  * elif t == NPY_LONG: f[0] = 108 #"l"
8159  * elif t == NPY_ULONG: f[0] = 76 #"L"
8160  */
8161  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 888, __pyx_L1_error)
8162  __Pyx_GOTREF(__pyx_t_3);
8163  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 888, __pyx_L1_error)
8164  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8165  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 888, __pyx_L1_error)
8166  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8167  if (__pyx_t_6) {
8168  (__pyx_v_f[0]) = 73;
8169  goto __pyx_L15;
8170  }
8171 
8172  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":889
8173  * elif t == NPY_INT: f[0] = 105 #"i"
8174  * elif t == NPY_UINT: f[0] = 73 #"I"
8175  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
8176  * elif t == NPY_ULONG: f[0] = 76 #"L"
8177  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8178  */
8179  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error)
8180  __Pyx_GOTREF(__pyx_t_4);
8181  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 889, __pyx_L1_error)
8182  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8183  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 889, __pyx_L1_error)
8184  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8185  if (__pyx_t_6) {
8186  (__pyx_v_f[0]) = 0x6C;
8187  goto __pyx_L15;
8188  }
8189 
8190  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":890
8191  * elif t == NPY_UINT: f[0] = 73 #"I"
8192  * elif t == NPY_LONG: f[0] = 108 #"l"
8193  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
8194  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8195  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8196  */
8197  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error)
8198  __Pyx_GOTREF(__pyx_t_3);
8199  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 890, __pyx_L1_error)
8200  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8201  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 890, __pyx_L1_error)
8202  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8203  if (__pyx_t_6) {
8204  (__pyx_v_f[0]) = 76;
8205  goto __pyx_L15;
8206  }
8207 
8208  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":891
8209  * elif t == NPY_LONG: f[0] = 108 #"l"
8210  * elif t == NPY_ULONG: f[0] = 76 #"L"
8211  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
8212  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8213  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8214  */
8215  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 891, __pyx_L1_error)
8216  __Pyx_GOTREF(__pyx_t_4);
8217  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error)
8218  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8219  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 891, __pyx_L1_error)
8220  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8221  if (__pyx_t_6) {
8222  (__pyx_v_f[0]) = 0x71;
8223  goto __pyx_L15;
8224  }
8225 
8226  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":892
8227  * elif t == NPY_ULONG: f[0] = 76 #"L"
8228  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8229  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
8230  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8231  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8232  */
8233  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 892, __pyx_L1_error)
8234  __Pyx_GOTREF(__pyx_t_3);
8235  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 892, __pyx_L1_error)
8236  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8237  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 892, __pyx_L1_error)
8238  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8239  if (__pyx_t_6) {
8240  (__pyx_v_f[0]) = 81;
8241  goto __pyx_L15;
8242  }
8243 
8244  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":893
8245  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8246  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8247  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
8248  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8249  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8250  */
8251  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 893, __pyx_L1_error)
8252  __Pyx_GOTREF(__pyx_t_4);
8253  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 893, __pyx_L1_error)
8254  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8255  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 893, __pyx_L1_error)
8256  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8257  if (__pyx_t_6) {
8258  (__pyx_v_f[0]) = 0x66;
8259  goto __pyx_L15;
8260  }
8261 
8262  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":894
8263  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8264  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8265  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
8266  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8267  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8268  */
8269  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 894, __pyx_L1_error)
8270  __Pyx_GOTREF(__pyx_t_3);
8271  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 894, __pyx_L1_error)
8272  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8273  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 894, __pyx_L1_error)
8274  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8275  if (__pyx_t_6) {
8276  (__pyx_v_f[0]) = 0x64;
8277  goto __pyx_L15;
8278  }
8279 
8280  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":895
8281  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8282  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8283  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
8284  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8285  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8286  */
8287  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error)
8288  __Pyx_GOTREF(__pyx_t_4);
8289  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 895, __pyx_L1_error)
8290  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8291  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 895, __pyx_L1_error)
8292  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8293  if (__pyx_t_6) {
8294  (__pyx_v_f[0]) = 0x67;
8295  goto __pyx_L15;
8296  }
8297 
8298  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":896
8299  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8300  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8301  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
8302  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8303  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8304  */
8305  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 896, __pyx_L1_error)
8306  __Pyx_GOTREF(__pyx_t_3);
8307  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 896, __pyx_L1_error)
8308  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8309  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 896, __pyx_L1_error)
8310  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8311  if (__pyx_t_6) {
8312  (__pyx_v_f[0]) = 90;
8313  (__pyx_v_f[1]) = 0x66;
8314  __pyx_v_f = (__pyx_v_f + 1);
8315  goto __pyx_L15;
8316  }
8317 
8318  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":897
8319  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8320  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8321  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
8322  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8323  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8324  */
8325  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error)
8326  __Pyx_GOTREF(__pyx_t_4);
8327  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 897, __pyx_L1_error)
8328  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8329  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 897, __pyx_L1_error)
8330  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8331  if (__pyx_t_6) {
8332  (__pyx_v_f[0]) = 90;
8333  (__pyx_v_f[1]) = 0x64;
8334  __pyx_v_f = (__pyx_v_f + 1);
8335  goto __pyx_L15;
8336  }
8337 
8338  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":898
8339  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8340  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8341  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
8342  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8343  * else:
8344  */
8345  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 898, __pyx_L1_error)
8346  __Pyx_GOTREF(__pyx_t_3);
8347  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 898, __pyx_L1_error)
8348  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8349  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 898, __pyx_L1_error)
8350  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8351  if (__pyx_t_6) {
8352  (__pyx_v_f[0]) = 90;
8353  (__pyx_v_f[1]) = 0x67;
8354  __pyx_v_f = (__pyx_v_f + 1);
8355  goto __pyx_L15;
8356  }
8357 
8358  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":899
8359  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8360  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8361  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
8362  * else:
8363  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
8364  */
8365  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 899, __pyx_L1_error)
8366  __Pyx_GOTREF(__pyx_t_4);
8367  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 899, __pyx_L1_error)
8368  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8369  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 899, __pyx_L1_error)
8370  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8371  if (likely(__pyx_t_6)) {
8372  (__pyx_v_f[0]) = 79;
8373  goto __pyx_L15;
8374  }
8375 
8376  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":901
8377  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8378  * else:
8379  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
8380  * f += 1
8381  * else:
8382  */
8383  /*else*/ {
8384  __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 901, __pyx_L1_error)
8385  __Pyx_GOTREF(__pyx_t_3);
8386  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 901, __pyx_L1_error)
8387  __Pyx_GOTREF(__pyx_t_4);
8388  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8389  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8390  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8391  __PYX_ERR(1, 901, __pyx_L1_error)
8392  }
8393  __pyx_L15:;
8394 
8395  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":902
8396  * else:
8397  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
8398  * f += 1 # <<<<<<<<<<<<<<
8399  * else:
8400  * # Cython ignores struct boundary information ("T{...}"),
8401  */
8402  __pyx_v_f = (__pyx_v_f + 1);
8403 
8404  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
8405  * offset[0] += child.itemsize
8406  *
8407  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
8408  * t = child.type_num
8409  * if end - f < 5:
8410  */
8411  goto __pyx_L13;
8412  }
8413 
8414  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":906
8415  * # Cython ignores struct boundary information ("T{...}"),
8416  * # so don't output it
8417  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
8418  * return f
8419  *
8420  */
8421  /*else*/ {
8422  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 906, __pyx_L1_error)
8423  __pyx_v_f = __pyx_t_9;
8424  }
8425  __pyx_L13:;
8426 
8427  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
8428  * cdef tuple fields
8429  *
8430  * for childname in descr.names: # <<<<<<<<<<<<<<
8431  * fields = descr.fields[childname]
8432  * child, new_offset = fields
8433  */
8434  }
8435  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8436 
8437  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":907
8438  * # so don't output it
8439  * f = _util_dtypestring(child, f, end, offset)
8440  * return f # <<<<<<<<<<<<<<
8441  *
8442  *
8443  */
8444  __pyx_r = __pyx_v_f;
8445  goto __pyx_L0;
8446 
8447  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
8448  * return ()
8449  *
8450  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
8451  * # Recursive utility function used in __getbuffer__ to get format
8452  * # string. The new location in the format string is returned.
8453  */
8454 
8455  /* function exit code */
8456  __pyx_L1_error:;
8457  __Pyx_XDECREF(__pyx_t_1);
8458  __Pyx_XDECREF(__pyx_t_3);
8459  __Pyx_XDECREF(__pyx_t_4);
8460  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
8461  __pyx_r = NULL;
8462  __pyx_L0:;
8463  __Pyx_XDECREF((PyObject *)__pyx_v_child);
8464  __Pyx_XDECREF(__pyx_v_fields);
8465  __Pyx_XDECREF(__pyx_v_childname);
8466  __Pyx_XDECREF(__pyx_v_new_offset);
8467  __Pyx_XDECREF(__pyx_v_t);
8468  __Pyx_RefNannyFinishContext();
8469  return __pyx_r;
8470 }
8471 
8472 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
8473  * int _import_umath() except -1
8474  *
8475  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
8476  * Py_INCREF(base) # important to do this before stealing the reference below!
8477  * PyArray_SetBaseObject(arr, base)
8478  */
8479 
8480 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
8481  __Pyx_RefNannyDeclarations
8482  __Pyx_RefNannySetupContext("set_array_base", 0);
8483 
8484  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1023
8485  *
8486  * cdef inline void set_array_base(ndarray arr, object base):
8487  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
8488  * PyArray_SetBaseObject(arr, base)
8489  *
8490  */
8491  Py_INCREF(__pyx_v_base);
8492 
8493  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1024
8494  * cdef inline void set_array_base(ndarray arr, object base):
8495  * Py_INCREF(base) # important to do this before stealing the reference below!
8496  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
8497  *
8498  * cdef inline object get_array_base(ndarray arr):
8499  */
8500  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
8501 
8502  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
8503  * int _import_umath() except -1
8504  *
8505  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
8506  * Py_INCREF(base) # important to do this before stealing the reference below!
8507  * PyArray_SetBaseObject(arr, base)
8508  */
8509 
8510  /* function exit code */
8511  __Pyx_RefNannyFinishContext();
8512 }
8513 
8514 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
8515  * PyArray_SetBaseObject(arr, base)
8516  *
8517  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8518  * base = PyArray_BASE(arr)
8519  * if base is NULL:
8520  */
8521 
8522 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
8523  PyObject *__pyx_v_base;
8524  PyObject *__pyx_r = NULL;
8525  __Pyx_RefNannyDeclarations
8526  int __pyx_t_1;
8527  __Pyx_RefNannySetupContext("get_array_base", 0);
8528 
8529  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1027
8530  *
8531  * cdef inline object get_array_base(ndarray arr):
8532  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
8533  * if base is NULL:
8534  * return None
8535  */
8536  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
8537 
8538  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
8539  * cdef inline object get_array_base(ndarray arr):
8540  * base = PyArray_BASE(arr)
8541  * if base is NULL: # <<<<<<<<<<<<<<
8542  * return None
8543  * return <object>base
8544  */
8545  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
8546  if (__pyx_t_1) {
8547 
8548  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1029
8549  * base = PyArray_BASE(arr)
8550  * if base is NULL:
8551  * return None # <<<<<<<<<<<<<<
8552  * return <object>base
8553  *
8554  */
8555  __Pyx_XDECREF(__pyx_r);
8556  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8557  goto __pyx_L0;
8558 
8559  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
8560  * cdef inline object get_array_base(ndarray arr):
8561  * base = PyArray_BASE(arr)
8562  * if base is NULL: # <<<<<<<<<<<<<<
8563  * return None
8564  * return <object>base
8565  */
8566  }
8567 
8568  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1030
8569  * if base is NULL:
8570  * return None
8571  * return <object>base # <<<<<<<<<<<<<<
8572  *
8573  * # Versions of the import_* functions which are more suitable for
8574  */
8575  __Pyx_XDECREF(__pyx_r);
8576  __Pyx_INCREF(((PyObject *)__pyx_v_base));
8577  __pyx_r = ((PyObject *)__pyx_v_base);
8578  goto __pyx_L0;
8579 
8580  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
8581  * PyArray_SetBaseObject(arr, base)
8582  *
8583  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8584  * base = PyArray_BASE(arr)
8585  * if base is NULL:
8586  */
8587 
8588  /* function exit code */
8589  __pyx_L0:;
8590  __Pyx_XGIVEREF(__pyx_r);
8591  __Pyx_RefNannyFinishContext();
8592  return __pyx_r;
8593 }
8594 
8595 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
8596  * # Versions of the import_* functions which are more suitable for
8597  * # Cython code.
8598  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8599  * try:
8600  * _import_array()
8601  */
8602 
8603 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
8604  int __pyx_r;
8605  __Pyx_RefNannyDeclarations
8606  PyObject *__pyx_t_1 = NULL;
8607  PyObject *__pyx_t_2 = NULL;
8608  PyObject *__pyx_t_3 = NULL;
8609  int __pyx_t_4;
8610  PyObject *__pyx_t_5 = NULL;
8611  PyObject *__pyx_t_6 = NULL;
8612  PyObject *__pyx_t_7 = NULL;
8613  PyObject *__pyx_t_8 = NULL;
8614  __Pyx_RefNannySetupContext("import_array", 0);
8615 
8616  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8617  * # Cython code.
8618  * cdef inline int import_array() except -1:
8619  * try: # <<<<<<<<<<<<<<
8620  * _import_array()
8621  * except Exception:
8622  */
8623  {
8624  __Pyx_PyThreadState_declare
8625  __Pyx_PyThreadState_assign
8626  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8627  __Pyx_XGOTREF(__pyx_t_1);
8628  __Pyx_XGOTREF(__pyx_t_2);
8629  __Pyx_XGOTREF(__pyx_t_3);
8630  /*try:*/ {
8631 
8632  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1036
8633  * cdef inline int import_array() except -1:
8634  * try:
8635  * _import_array() # <<<<<<<<<<<<<<
8636  * except Exception:
8637  * raise ImportError("numpy.core.multiarray failed to import")
8638  */
8639  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1036, __pyx_L3_error)
8640 
8641  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8642  * # Cython code.
8643  * cdef inline int import_array() except -1:
8644  * try: # <<<<<<<<<<<<<<
8645  * _import_array()
8646  * except Exception:
8647  */
8648  }
8649  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8650  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8651  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8652  goto __pyx_L8_try_end;
8653  __pyx_L3_error:;
8654 
8655  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1037
8656  * try:
8657  * _import_array()
8658  * except Exception: # <<<<<<<<<<<<<<
8659  * raise ImportError("numpy.core.multiarray failed to import")
8660  *
8661  */
8662  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8663  if (__pyx_t_4) {
8664  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8665  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1037, __pyx_L5_except_error)
8666  __Pyx_GOTREF(__pyx_t_5);
8667  __Pyx_GOTREF(__pyx_t_6);
8668  __Pyx_GOTREF(__pyx_t_7);
8669 
8670  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
8671  * _import_array()
8672  * except Exception:
8673  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
8674  *
8675  * cdef inline int import_umath() except -1:
8676  */
8677  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1038, __pyx_L5_except_error)
8678  __Pyx_GOTREF(__pyx_t_8);
8679  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8680  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8681  __PYX_ERR(1, 1038, __pyx_L5_except_error)
8682  }
8683  goto __pyx_L5_except_error;
8684  __pyx_L5_except_error:;
8685 
8686  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8687  * # Cython code.
8688  * cdef inline int import_array() except -1:
8689  * try: # <<<<<<<<<<<<<<
8690  * _import_array()
8691  * except Exception:
8692  */
8693  __Pyx_XGIVEREF(__pyx_t_1);
8694  __Pyx_XGIVEREF(__pyx_t_2);
8695  __Pyx_XGIVEREF(__pyx_t_3);
8696  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8697  goto __pyx_L1_error;
8698  __pyx_L8_try_end:;
8699  }
8700 
8701  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
8702  * # Versions of the import_* functions which are more suitable for
8703  * # Cython code.
8704  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8705  * try:
8706  * _import_array()
8707  */
8708 
8709  /* function exit code */
8710  __pyx_r = 0;
8711  goto __pyx_L0;
8712  __pyx_L1_error:;
8713  __Pyx_XDECREF(__pyx_t_5);
8714  __Pyx_XDECREF(__pyx_t_6);
8715  __Pyx_XDECREF(__pyx_t_7);
8716  __Pyx_XDECREF(__pyx_t_8);
8717  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8718  __pyx_r = -1;
8719  __pyx_L0:;
8720  __Pyx_RefNannyFinishContext();
8721  return __pyx_r;
8722 }
8723 
8724 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
8725  * raise ImportError("numpy.core.multiarray failed to import")
8726  *
8727  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8728  * try:
8729  * _import_umath()
8730  */
8731 
8732 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
8733  int __pyx_r;
8734  __Pyx_RefNannyDeclarations
8735  PyObject *__pyx_t_1 = NULL;
8736  PyObject *__pyx_t_2 = NULL;
8737  PyObject *__pyx_t_3 = NULL;
8738  int __pyx_t_4;
8739  PyObject *__pyx_t_5 = NULL;
8740  PyObject *__pyx_t_6 = NULL;
8741  PyObject *__pyx_t_7 = NULL;
8742  PyObject *__pyx_t_8 = NULL;
8743  __Pyx_RefNannySetupContext("import_umath", 0);
8744 
8745  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
8746  *
8747  * cdef inline int import_umath() except -1:
8748  * try: # <<<<<<<<<<<<<<
8749  * _import_umath()
8750  * except Exception:
8751  */
8752  {
8753  __Pyx_PyThreadState_declare
8754  __Pyx_PyThreadState_assign
8755  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8756  __Pyx_XGOTREF(__pyx_t_1);
8757  __Pyx_XGOTREF(__pyx_t_2);
8758  __Pyx_XGOTREF(__pyx_t_3);
8759  /*try:*/ {
8760 
8761  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1042
8762  * cdef inline int import_umath() except -1:
8763  * try:
8764  * _import_umath() # <<<<<<<<<<<<<<
8765  * except Exception:
8766  * raise ImportError("numpy.core.umath failed to import")
8767  */
8768  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1042, __pyx_L3_error)
8769 
8770  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
8771  *
8772  * cdef inline int import_umath() except -1:
8773  * try: # <<<<<<<<<<<<<<
8774  * _import_umath()
8775  * except Exception:
8776  */
8777  }
8778  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8779  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8780  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8781  goto __pyx_L8_try_end;
8782  __pyx_L3_error:;
8783 
8784  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1043
8785  * try:
8786  * _import_umath()
8787  * except Exception: # <<<<<<<<<<<<<<
8788  * raise ImportError("numpy.core.umath failed to import")
8789  *
8790  */
8791  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8792  if (__pyx_t_4) {
8793  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8794  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1043, __pyx_L5_except_error)
8795  __Pyx_GOTREF(__pyx_t_5);
8796  __Pyx_GOTREF(__pyx_t_6);
8797  __Pyx_GOTREF(__pyx_t_7);
8798 
8799  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
8800  * _import_umath()
8801  * except Exception:
8802  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8803  *
8804  * cdef inline int import_ufunc() except -1:
8805  */
8806  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1044, __pyx_L5_except_error)
8807  __Pyx_GOTREF(__pyx_t_8);
8808  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8809  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8810  __PYX_ERR(1, 1044, __pyx_L5_except_error)
8811  }
8812  goto __pyx_L5_except_error;
8813  __pyx_L5_except_error:;
8814 
8815  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
8816  *
8817  * cdef inline int import_umath() except -1:
8818  * try: # <<<<<<<<<<<<<<
8819  * _import_umath()
8820  * except Exception:
8821  */
8822  __Pyx_XGIVEREF(__pyx_t_1);
8823  __Pyx_XGIVEREF(__pyx_t_2);
8824  __Pyx_XGIVEREF(__pyx_t_3);
8825  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8826  goto __pyx_L1_error;
8827  __pyx_L8_try_end:;
8828  }
8829 
8830  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
8831  * raise ImportError("numpy.core.multiarray failed to import")
8832  *
8833  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8834  * try:
8835  * _import_umath()
8836  */
8837 
8838  /* function exit code */
8839  __pyx_r = 0;
8840  goto __pyx_L0;
8841  __pyx_L1_error:;
8842  __Pyx_XDECREF(__pyx_t_5);
8843  __Pyx_XDECREF(__pyx_t_6);
8844  __Pyx_XDECREF(__pyx_t_7);
8845  __Pyx_XDECREF(__pyx_t_8);
8846  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8847  __pyx_r = -1;
8848  __pyx_L0:;
8849  __Pyx_RefNannyFinishContext();
8850  return __pyx_r;
8851 }
8852 
8853 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
8854  * raise ImportError("numpy.core.umath failed to import")
8855  *
8856  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8857  * try:
8858  * _import_umath()
8859  */
8860 
8861 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
8862  int __pyx_r;
8863  __Pyx_RefNannyDeclarations
8864  PyObject *__pyx_t_1 = NULL;
8865  PyObject *__pyx_t_2 = NULL;
8866  PyObject *__pyx_t_3 = NULL;
8867  int __pyx_t_4;
8868  PyObject *__pyx_t_5 = NULL;
8869  PyObject *__pyx_t_6 = NULL;
8870  PyObject *__pyx_t_7 = NULL;
8871  PyObject *__pyx_t_8 = NULL;
8872  __Pyx_RefNannySetupContext("import_ufunc", 0);
8873 
8874  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
8875  *
8876  * cdef inline int import_ufunc() except -1:
8877  * try: # <<<<<<<<<<<<<<
8878  * _import_umath()
8879  * except Exception:
8880  */
8881  {
8882  __Pyx_PyThreadState_declare
8883  __Pyx_PyThreadState_assign
8884  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8885  __Pyx_XGOTREF(__pyx_t_1);
8886  __Pyx_XGOTREF(__pyx_t_2);
8887  __Pyx_XGOTREF(__pyx_t_3);
8888  /*try:*/ {
8889 
8890  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1048
8891  * cdef inline int import_ufunc() except -1:
8892  * try:
8893  * _import_umath() # <<<<<<<<<<<<<<
8894  * except Exception:
8895  * raise ImportError("numpy.core.umath failed to import")
8896  */
8897  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1048, __pyx_L3_error)
8898 
8899  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
8900  *
8901  * cdef inline int import_ufunc() except -1:
8902  * try: # <<<<<<<<<<<<<<
8903  * _import_umath()
8904  * except Exception:
8905  */
8906  }
8907  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8908  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8909  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8910  goto __pyx_L8_try_end;
8911  __pyx_L3_error:;
8912 
8913  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1049
8914  * try:
8915  * _import_umath()
8916  * except Exception: # <<<<<<<<<<<<<<
8917  * raise ImportError("numpy.core.umath failed to import")
8918  */
8919  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8920  if (__pyx_t_4) {
8921  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8922  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1049, __pyx_L5_except_error)
8923  __Pyx_GOTREF(__pyx_t_5);
8924  __Pyx_GOTREF(__pyx_t_6);
8925  __Pyx_GOTREF(__pyx_t_7);
8926 
8927  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1050
8928  * _import_umath()
8929  * except Exception:
8930  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8931  */
8932  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1050, __pyx_L5_except_error)
8933  __Pyx_GOTREF(__pyx_t_8);
8934  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8935  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8936  __PYX_ERR(1, 1050, __pyx_L5_except_error)
8937  }
8938  goto __pyx_L5_except_error;
8939  __pyx_L5_except_error:;
8940 
8941  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
8942  *
8943  * cdef inline int import_ufunc() except -1:
8944  * try: # <<<<<<<<<<<<<<
8945  * _import_umath()
8946  * except Exception:
8947  */
8948  __Pyx_XGIVEREF(__pyx_t_1);
8949  __Pyx_XGIVEREF(__pyx_t_2);
8950  __Pyx_XGIVEREF(__pyx_t_3);
8951  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8952  goto __pyx_L1_error;
8953  __pyx_L8_try_end:;
8954  }
8955 
8956  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
8957  * raise ImportError("numpy.core.umath failed to import")
8958  *
8959  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8960  * try:
8961  * _import_umath()
8962  */
8963 
8964  /* function exit code */
8965  __pyx_r = 0;
8966  goto __pyx_L0;
8967  __pyx_L1_error:;
8968  __Pyx_XDECREF(__pyx_t_5);
8969  __Pyx_XDECREF(__pyx_t_6);
8970  __Pyx_XDECREF(__pyx_t_7);
8971  __Pyx_XDECREF(__pyx_t_8);
8972  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8973  __pyx_r = -1;
8974  __pyx_L0:;
8975  __Pyx_RefNannyFinishContext();
8976  return __pyx_r;
8977 }
8978 
8979 /* "View.MemoryView":122
8980  * cdef bint dtype_is_object
8981  *
8982  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8983  * mode="c", bint allocate_buffer=True):
8984  *
8985  */
8986 
8987 /* Python wrapper */
8988 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8989 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8990  PyObject *__pyx_v_shape = 0;
8991  Py_ssize_t __pyx_v_itemsize;
8992  PyObject *__pyx_v_format = 0;
8993  PyObject *__pyx_v_mode = 0;
8994  int __pyx_v_allocate_buffer;
8995  int __pyx_r;
8996  __Pyx_RefNannyDeclarations
8997  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8998  {
8999  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
9000  PyObject* values[5] = {0,0,0,0,0};
9001  values[3] = ((PyObject *)__pyx_n_s_c);
9002  if (unlikely(__pyx_kwds)) {
9003  Py_ssize_t kw_args;
9004  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9005  switch (pos_args) {
9006  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9007  CYTHON_FALLTHROUGH;
9008  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9009  CYTHON_FALLTHROUGH;
9010  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9011  CYTHON_FALLTHROUGH;
9012  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9013  CYTHON_FALLTHROUGH;
9014  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9015  CYTHON_FALLTHROUGH;
9016  case 0: break;
9017  default: goto __pyx_L5_argtuple_error;
9018  }
9019  kw_args = PyDict_Size(__pyx_kwds);
9020  switch (pos_args) {
9021  case 0:
9022  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
9023  else goto __pyx_L5_argtuple_error;
9024  CYTHON_FALLTHROUGH;
9025  case 1:
9026  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
9027  else {
9028  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 122, __pyx_L3_error)
9029  }
9030  CYTHON_FALLTHROUGH;
9031  case 2:
9032  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
9033  else {
9034  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 122, __pyx_L3_error)
9035  }
9036  CYTHON_FALLTHROUGH;
9037  case 3:
9038  if (kw_args > 0) {
9039  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
9040  if (value) { values[3] = value; kw_args--; }
9041  }
9042  CYTHON_FALLTHROUGH;
9043  case 4:
9044  if (kw_args > 0) {
9045  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
9046  if (value) { values[4] = value; kw_args--; }
9047  }
9048  }
9049  if (unlikely(kw_args > 0)) {
9050  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 122, __pyx_L3_error)
9051  }
9052  } else {
9053  switch (PyTuple_GET_SIZE(__pyx_args)) {
9054  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9055  CYTHON_FALLTHROUGH;
9056  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9057  CYTHON_FALLTHROUGH;
9058  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9059  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9060  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9061  break;
9062  default: goto __pyx_L5_argtuple_error;
9063  }
9064  }
9065  __pyx_v_shape = ((PyObject*)values[0]);
9066  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error)
9067  __pyx_v_format = values[2];
9068  __pyx_v_mode = values[3];
9069  if (values[4]) {
9070  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error)
9071  } else {
9072 
9073  /* "View.MemoryView":123
9074  *
9075  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
9076  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
9077  *
9078  * cdef int idx
9079  */
9080  __pyx_v_allocate_buffer = ((int)1);
9081  }
9082  }
9083  goto __pyx_L4_argument_unpacking_done;
9084  __pyx_L5_argtuple_error:;
9085  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 122, __pyx_L3_error)
9086  __pyx_L3_error:;
9087  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9088  __Pyx_RefNannyFinishContext();
9089  return -1;
9090  __pyx_L4_argument_unpacking_done:;
9091  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 122, __pyx_L1_error)
9092  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
9093  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 122, __pyx_L1_error)
9094  }
9095  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
9096 
9097  /* "View.MemoryView":122
9098  * cdef bint dtype_is_object
9099  *
9100  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9101  * mode="c", bint allocate_buffer=True):
9102  *
9103  */
9104 
9105  /* function exit code */
9106  goto __pyx_L0;
9107  __pyx_L1_error:;
9108  __pyx_r = -1;
9109  __pyx_L0:;
9110  __Pyx_RefNannyFinishContext();
9111  return __pyx_r;
9112 }
9113 
9114 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
9115  int __pyx_v_idx;
9116  Py_ssize_t __pyx_v_i;
9117  Py_ssize_t __pyx_v_dim;
9118  PyObject **__pyx_v_p;
9119  char __pyx_v_order;
9120  int __pyx_r;
9121  __Pyx_RefNannyDeclarations
9122  Py_ssize_t __pyx_t_1;
9123  int __pyx_t_2;
9124  PyObject *__pyx_t_3 = NULL;
9125  int __pyx_t_4;
9126  PyObject *__pyx_t_5 = NULL;
9127  PyObject *__pyx_t_6 = NULL;
9128  char *__pyx_t_7;
9129  int __pyx_t_8;
9130  Py_ssize_t __pyx_t_9;
9131  PyObject *__pyx_t_10 = NULL;
9132  Py_ssize_t __pyx_t_11;
9133  __Pyx_RefNannySetupContext("__cinit__", 0);
9134  __Pyx_INCREF(__pyx_v_format);
9135 
9136  /* "View.MemoryView":129
9137  * cdef PyObject **p
9138  *
9139  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
9140  * self.itemsize = itemsize
9141  *
9142  */
9143  if (unlikely(__pyx_v_shape == Py_None)) {
9144  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
9145  __PYX_ERR(2, 129, __pyx_L1_error)
9146  }
9147  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 129, __pyx_L1_error)
9148  __pyx_v_self->ndim = ((int)__pyx_t_1);
9149 
9150  /* "View.MemoryView":130
9151  *
9152  * self.ndim = <int> len(shape)
9153  * self.itemsize = itemsize # <<<<<<<<<<<<<<
9154  *
9155  * if not self.ndim:
9156  */
9157  __pyx_v_self->itemsize = __pyx_v_itemsize;
9158 
9159  /* "View.MemoryView":132
9160  * self.itemsize = itemsize
9161  *
9162  * if not self.ndim: # <<<<<<<<<<<<<<
9163  * raise ValueError("Empty shape tuple for cython.array")
9164  *
9165  */
9166  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
9167  if (unlikely(__pyx_t_2)) {
9168 
9169  /* "View.MemoryView":133
9170  *
9171  * if not self.ndim:
9172  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
9173  *
9174  * if itemsize <= 0:
9175  */
9176  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error)
9177  __Pyx_GOTREF(__pyx_t_3);
9178  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9179  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9180  __PYX_ERR(2, 133, __pyx_L1_error)
9181 
9182  /* "View.MemoryView":132
9183  * self.itemsize = itemsize
9184  *
9185  * if not self.ndim: # <<<<<<<<<<<<<<
9186  * raise ValueError("Empty shape tuple for cython.array")
9187  *
9188  */
9189  }
9190 
9191  /* "View.MemoryView":135
9192  * raise ValueError("Empty shape tuple for cython.array")
9193  *
9194  * if itemsize <= 0: # <<<<<<<<<<<<<<
9195  * raise ValueError("itemsize <= 0 for cython.array")
9196  *
9197  */
9198  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
9199  if (unlikely(__pyx_t_2)) {
9200 
9201  /* "View.MemoryView":136
9202  *
9203  * if itemsize <= 0:
9204  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
9205  *
9206  * if not isinstance(format, bytes):
9207  */
9208  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error)
9209  __Pyx_GOTREF(__pyx_t_3);
9210  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9211  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9212  __PYX_ERR(2, 136, __pyx_L1_error)
9213 
9214  /* "View.MemoryView":135
9215  * raise ValueError("Empty shape tuple for cython.array")
9216  *
9217  * if itemsize <= 0: # <<<<<<<<<<<<<<
9218  * raise ValueError("itemsize <= 0 for cython.array")
9219  *
9220  */
9221  }
9222 
9223  /* "View.MemoryView":138
9224  * raise ValueError("itemsize <= 0 for cython.array")
9225  *
9226  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
9227  * format = format.encode('ASCII')
9228  * self._format = format # keep a reference to the byte string
9229  */
9230  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
9231  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
9232  if (__pyx_t_4) {
9233 
9234  /* "View.MemoryView":139
9235  *
9236  * if not isinstance(format, bytes):
9237  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
9238  * self._format = format # keep a reference to the byte string
9239  * self.format = self._format
9240  */
9241  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 139, __pyx_L1_error)
9242  __Pyx_GOTREF(__pyx_t_5);
9243  __pyx_t_6 = NULL;
9244  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
9245  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9246  if (likely(__pyx_t_6)) {
9247  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9248  __Pyx_INCREF(__pyx_t_6);
9249  __Pyx_INCREF(function);
9250  __Pyx_DECREF_SET(__pyx_t_5, function);
9251  }
9252  }
9253  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
9254  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9255  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 139, __pyx_L1_error)
9256  __Pyx_GOTREF(__pyx_t_3);
9257  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9258  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
9259  __pyx_t_3 = 0;
9260 
9261  /* "View.MemoryView":138
9262  * raise ValueError("itemsize <= 0 for cython.array")
9263  *
9264  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
9265  * format = format.encode('ASCII')
9266  * self._format = format # keep a reference to the byte string
9267  */
9268  }
9269 
9270  /* "View.MemoryView":140
9271  * if not isinstance(format, bytes):
9272  * format = format.encode('ASCII')
9273  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
9274  * self.format = self._format
9275  *
9276  */
9277  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 140, __pyx_L1_error)
9278  __pyx_t_3 = __pyx_v_format;
9279  __Pyx_INCREF(__pyx_t_3);
9280  __Pyx_GIVEREF(__pyx_t_3);
9281  __Pyx_GOTREF(__pyx_v_self->_format);
9282  __Pyx_DECREF(__pyx_v_self->_format);
9283  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
9284  __pyx_t_3 = 0;
9285 
9286  /* "View.MemoryView":141
9287  * format = format.encode('ASCII')
9288  * self._format = format # keep a reference to the byte string
9289  * self.format = self._format # <<<<<<<<<<<<<<
9290  *
9291  *
9292  */
9293  if (unlikely(__pyx_v_self->_format == Py_None)) {
9294  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
9295  __PYX_ERR(2, 141, __pyx_L1_error)
9296  }
9297  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 141, __pyx_L1_error)
9298  __pyx_v_self->format = __pyx_t_7;
9299 
9300  /* "View.MemoryView":144
9301  *
9302  *
9303  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
9304  * self._strides = self._shape + self.ndim
9305  *
9306  */
9307  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
9308 
9309  /* "View.MemoryView":145
9310  *
9311  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
9312  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
9313  *
9314  * if not self._shape:
9315  */
9316  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
9317 
9318  /* "View.MemoryView":147
9319  * self._strides = self._shape + self.ndim
9320  *
9321  * if not self._shape: # <<<<<<<<<<<<<<
9322  * raise MemoryError("unable to allocate shape and strides.")
9323  *
9324  */
9325  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
9326  if (unlikely(__pyx_t_4)) {
9327 
9328  /* "View.MemoryView":148
9329  *
9330  * if not self._shape:
9331  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
9332  *
9333  *
9334  */
9335  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error)
9336  __Pyx_GOTREF(__pyx_t_3);
9337  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9338  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9339  __PYX_ERR(2, 148, __pyx_L1_error)
9340 
9341  /* "View.MemoryView":147
9342  * self._strides = self._shape + self.ndim
9343  *
9344  * if not self._shape: # <<<<<<<<<<<<<<
9345  * raise MemoryError("unable to allocate shape and strides.")
9346  *
9347  */
9348  }
9349 
9350  /* "View.MemoryView":151
9351  *
9352  *
9353  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
9354  * if dim <= 0:
9355  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9356  */
9357  __pyx_t_8 = 0;
9358  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
9359  for (;;) {
9360  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
9361  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9362  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 151, __pyx_L1_error)
9363  #else
9364  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 151, __pyx_L1_error)
9365  __Pyx_GOTREF(__pyx_t_5);
9366  #endif
9367  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 151, __pyx_L1_error)
9368  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9369  __pyx_v_dim = __pyx_t_9;
9370  __pyx_v_idx = __pyx_t_8;
9371  __pyx_t_8 = (__pyx_t_8 + 1);
9372 
9373  /* "View.MemoryView":152
9374  *
9375  * for idx, dim in enumerate(shape):
9376  * if dim <= 0: # <<<<<<<<<<<<<<
9377  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9378  * self._shape[idx] = dim
9379  */
9380  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
9381  if (unlikely(__pyx_t_4)) {
9382 
9383  /* "View.MemoryView":153
9384  * for idx, dim in enumerate(shape):
9385  * if dim <= 0:
9386  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
9387  * self._shape[idx] = dim
9388  *
9389  */
9390  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error)
9391  __Pyx_GOTREF(__pyx_t_5);
9392  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
9393  __Pyx_GOTREF(__pyx_t_6);
9394  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
9395  __Pyx_GOTREF(__pyx_t_10);
9396  __Pyx_GIVEREF(__pyx_t_5);
9397  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
9398  __Pyx_GIVEREF(__pyx_t_6);
9399  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
9400  __pyx_t_5 = 0;
9401  __pyx_t_6 = 0;
9402  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
9403  __Pyx_GOTREF(__pyx_t_6);
9404  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9405  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
9406  __Pyx_GOTREF(__pyx_t_10);
9407  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9408  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9409  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9410  __PYX_ERR(2, 153, __pyx_L1_error)
9411 
9412  /* "View.MemoryView":152
9413  *
9414  * for idx, dim in enumerate(shape):
9415  * if dim <= 0: # <<<<<<<<<<<<<<
9416  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9417  * self._shape[idx] = dim
9418  */
9419  }
9420 
9421  /* "View.MemoryView":154
9422  * if dim <= 0:
9423  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9424  * self._shape[idx] = dim # <<<<<<<<<<<<<<
9425  *
9426  * cdef char order
9427  */
9428  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
9429 
9430  /* "View.MemoryView":151
9431  *
9432  *
9433  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
9434  * if dim <= 0:
9435  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9436  */
9437  }
9438  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9439 
9440  /* "View.MemoryView":157
9441  *
9442  * cdef char order
9443  * if mode == 'fortran': # <<<<<<<<<<<<<<
9444  * order = b'F'
9445  * self.mode = u'fortran'
9446  */
9447  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 157, __pyx_L1_error)
9448  if (__pyx_t_4) {
9449 
9450  /* "View.MemoryView":158
9451  * cdef char order
9452  * if mode == 'fortran':
9453  * order = b'F' # <<<<<<<<<<<<<<
9454  * self.mode = u'fortran'
9455  * elif mode == 'c':
9456  */
9457  __pyx_v_order = 'F';
9458 
9459  /* "View.MemoryView":159
9460  * if mode == 'fortran':
9461  * order = b'F'
9462  * self.mode = u'fortran' # <<<<<<<<<<<<<<
9463  * elif mode == 'c':
9464  * order = b'C'
9465  */
9466  __Pyx_INCREF(__pyx_n_u_fortran);
9467  __Pyx_GIVEREF(__pyx_n_u_fortran);
9468  __Pyx_GOTREF(__pyx_v_self->mode);
9469  __Pyx_DECREF(__pyx_v_self->mode);
9470  __pyx_v_self->mode = __pyx_n_u_fortran;
9471 
9472  /* "View.MemoryView":157
9473  *
9474  * cdef char order
9475  * if mode == 'fortran': # <<<<<<<<<<<<<<
9476  * order = b'F'
9477  * self.mode = u'fortran'
9478  */
9479  goto __pyx_L10;
9480  }
9481 
9482  /* "View.MemoryView":160
9483  * order = b'F'
9484  * self.mode = u'fortran'
9485  * elif mode == 'c': # <<<<<<<<<<<<<<
9486  * order = b'C'
9487  * self.mode = u'c'
9488  */
9489  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 160, __pyx_L1_error)
9490  if (likely(__pyx_t_4)) {
9491 
9492  /* "View.MemoryView":161
9493  * self.mode = u'fortran'
9494  * elif mode == 'c':
9495  * order = b'C' # <<<<<<<<<<<<<<
9496  * self.mode = u'c'
9497  * else:
9498  */
9499  __pyx_v_order = 'C';
9500 
9501  /* "View.MemoryView":162
9502  * elif mode == 'c':
9503  * order = b'C'
9504  * self.mode = u'c' # <<<<<<<<<<<<<<
9505  * else:
9506  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
9507  */
9508  __Pyx_INCREF(__pyx_n_u_c);
9509  __Pyx_GIVEREF(__pyx_n_u_c);
9510  __Pyx_GOTREF(__pyx_v_self->mode);
9511  __Pyx_DECREF(__pyx_v_self->mode);
9512  __pyx_v_self->mode = __pyx_n_u_c;
9513 
9514  /* "View.MemoryView":160
9515  * order = b'F'
9516  * self.mode = u'fortran'
9517  * elif mode == 'c': # <<<<<<<<<<<<<<
9518  * order = b'C'
9519  * self.mode = u'c'
9520  */
9521  goto __pyx_L10;
9522  }
9523 
9524  /* "View.MemoryView":164
9525  * self.mode = u'c'
9526  * else:
9527  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
9528  *
9529  * self.len = fill_contig_strides_array(self._shape, self._strides,
9530  */
9531  /*else*/ {
9532  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 164, __pyx_L1_error)
9533  __Pyx_GOTREF(__pyx_t_3);
9534  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 164, __pyx_L1_error)
9535  __Pyx_GOTREF(__pyx_t_10);
9536  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9537  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9538  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9539  __PYX_ERR(2, 164, __pyx_L1_error)
9540  }
9541  __pyx_L10:;
9542 
9543  /* "View.MemoryView":166
9544  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
9545  *
9546  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
9547  * itemsize, self.ndim, order)
9548  *
9549  */
9550  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
9551 
9552  /* "View.MemoryView":169
9553  * itemsize, self.ndim, order)
9554  *
9555  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
9556  * self.dtype_is_object = format == b'O'
9557  * if allocate_buffer:
9558  */
9559  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
9560 
9561  /* "View.MemoryView":170
9562  *
9563  * self.free_data = allocate_buffer
9564  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
9565  * if allocate_buffer:
9566  *
9567  */
9568  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error)
9569  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error)
9570  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9571  __pyx_v_self->dtype_is_object = __pyx_t_4;
9572 
9573  /* "View.MemoryView":171
9574  * self.free_data = allocate_buffer
9575  * self.dtype_is_object = format == b'O'
9576  * if allocate_buffer: # <<<<<<<<<<<<<<
9577  *
9578  *
9579  */
9580  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
9581  if (__pyx_t_4) {
9582 
9583  /* "View.MemoryView":174
9584  *
9585  *
9586  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
9587  * if not self.data:
9588  * raise MemoryError("unable to allocate array data.")
9589  */
9590  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
9591 
9592  /* "View.MemoryView":175
9593  *
9594  * self.data = <char *>malloc(self.len)
9595  * if not self.data: # <<<<<<<<<<<<<<
9596  * raise MemoryError("unable to allocate array data.")
9597  *
9598  */
9599  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9600  if (unlikely(__pyx_t_4)) {
9601 
9602  /* "View.MemoryView":176
9603  * self.data = <char *>malloc(self.len)
9604  * if not self.data:
9605  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
9606  *
9607  * if self.dtype_is_object:
9608  */
9609  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error)
9610  __Pyx_GOTREF(__pyx_t_10);
9611  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9612  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9613  __PYX_ERR(2, 176, __pyx_L1_error)
9614 
9615  /* "View.MemoryView":175
9616  *
9617  * self.data = <char *>malloc(self.len)
9618  * if not self.data: # <<<<<<<<<<<<<<
9619  * raise MemoryError("unable to allocate array data.")
9620  *
9621  */
9622  }
9623 
9624  /* "View.MemoryView":178
9625  * raise MemoryError("unable to allocate array data.")
9626  *
9627  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9628  * p = <PyObject **> self.data
9629  * for i in range(self.len / itemsize):
9630  */
9631  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9632  if (__pyx_t_4) {
9633 
9634  /* "View.MemoryView":179
9635  *
9636  * if self.dtype_is_object:
9637  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
9638  * for i in range(self.len / itemsize):
9639  * p[i] = Py_None
9640  */
9641  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9642 
9643  /* "View.MemoryView":180
9644  * if self.dtype_is_object:
9645  * p = <PyObject **> self.data
9646  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
9647  * p[i] = Py_None
9648  * Py_INCREF(Py_None)
9649  */
9650  if (unlikely(__pyx_v_itemsize == 0)) {
9651  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
9652  __PYX_ERR(2, 180, __pyx_L1_error)
9653  }
9654  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
9655  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
9656  __PYX_ERR(2, 180, __pyx_L1_error)
9657  }
9658  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9659  __pyx_t_9 = __pyx_t_1;
9660  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
9661  __pyx_v_i = __pyx_t_11;
9662 
9663  /* "View.MemoryView":181
9664  * p = <PyObject **> self.data
9665  * for i in range(self.len / itemsize):
9666  * p[i] = Py_None # <<<<<<<<<<<<<<
9667  * Py_INCREF(Py_None)
9668  *
9669  */
9670  (__pyx_v_p[__pyx_v_i]) = Py_None;
9671 
9672  /* "View.MemoryView":182
9673  * for i in range(self.len / itemsize):
9674  * p[i] = Py_None
9675  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9676  *
9677  * @cname('getbuffer')
9678  */
9679  Py_INCREF(Py_None);
9680  }
9681 
9682  /* "View.MemoryView":178
9683  * raise MemoryError("unable to allocate array data.")
9684  *
9685  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9686  * p = <PyObject **> self.data
9687  * for i in range(self.len / itemsize):
9688  */
9689  }
9690 
9691  /* "View.MemoryView":171
9692  * self.free_data = allocate_buffer
9693  * self.dtype_is_object = format == b'O'
9694  * if allocate_buffer: # <<<<<<<<<<<<<<
9695  *
9696  *
9697  */
9698  }
9699 
9700  /* "View.MemoryView":122
9701  * cdef bint dtype_is_object
9702  *
9703  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9704  * mode="c", bint allocate_buffer=True):
9705  *
9706  */
9707 
9708  /* function exit code */
9709  __pyx_r = 0;
9710  goto __pyx_L0;
9711  __pyx_L1_error:;
9712  __Pyx_XDECREF(__pyx_t_3);
9713  __Pyx_XDECREF(__pyx_t_5);
9714  __Pyx_XDECREF(__pyx_t_6);
9715  __Pyx_XDECREF(__pyx_t_10);
9716  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9717  __pyx_r = -1;
9718  __pyx_L0:;
9719  __Pyx_XDECREF(__pyx_v_format);
9720  __Pyx_RefNannyFinishContext();
9721  return __pyx_r;
9722 }
9723 
9724 /* "View.MemoryView":185
9725  *
9726  * @cname('getbuffer')
9727  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9728  * cdef int bufmode = -1
9729  * if self.mode == u"c":
9730  */
9731 
9732 /* Python wrapper */
9733 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9734 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9735  int __pyx_r;
9736  __Pyx_RefNannyDeclarations
9737  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9738  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9739 
9740  /* function exit code */
9741  __Pyx_RefNannyFinishContext();
9742  return __pyx_r;
9743 }
9744 
9745 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9746  int __pyx_v_bufmode;
9747  int __pyx_r;
9748  __Pyx_RefNannyDeclarations
9749  int __pyx_t_1;
9750  int __pyx_t_2;
9751  PyObject *__pyx_t_3 = NULL;
9752  char *__pyx_t_4;
9753  Py_ssize_t __pyx_t_5;
9754  int __pyx_t_6;
9755  Py_ssize_t *__pyx_t_7;
9756  if (__pyx_v_info == NULL) {
9757  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9758  return -1;
9759  }
9760  __Pyx_RefNannySetupContext("__getbuffer__", 0);
9761  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9762  __Pyx_GIVEREF(__pyx_v_info->obj);
9763 
9764  /* "View.MemoryView":186
9765  * @cname('getbuffer')
9766  * def __getbuffer__(self, Py_buffer *info, int flags):
9767  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
9768  * if self.mode == u"c":
9769  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9770  */
9771  __pyx_v_bufmode = -1;
9772 
9773  /* "View.MemoryView":187
9774  * def __getbuffer__(self, Py_buffer *info, int flags):
9775  * cdef int bufmode = -1
9776  * if self.mode == u"c": # <<<<<<<<<<<<<<
9777  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9778  * elif self.mode == u"fortran":
9779  */
9780  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
9781  __pyx_t_2 = (__pyx_t_1 != 0);
9782  if (__pyx_t_2) {
9783 
9784  /* "View.MemoryView":188
9785  * cdef int bufmode = -1
9786  * if self.mode == u"c":
9787  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9788  * elif self.mode == u"fortran":
9789  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9790  */
9791  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9792 
9793  /* "View.MemoryView":187
9794  * def __getbuffer__(self, Py_buffer *info, int flags):
9795  * cdef int bufmode = -1
9796  * if self.mode == u"c": # <<<<<<<<<<<<<<
9797  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9798  * elif self.mode == u"fortran":
9799  */
9800  goto __pyx_L3;
9801  }
9802 
9803  /* "View.MemoryView":189
9804  * if self.mode == u"c":
9805  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9806  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9807  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9808  * if not (flags & bufmode):
9809  */
9810  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 189, __pyx_L1_error)
9811  __pyx_t_1 = (__pyx_t_2 != 0);
9812  if (__pyx_t_1) {
9813 
9814  /* "View.MemoryView":190
9815  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9816  * elif self.mode == u"fortran":
9817  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9818  * if not (flags & bufmode):
9819  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9820  */
9821  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9822 
9823  /* "View.MemoryView":189
9824  * if self.mode == u"c":
9825  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9826  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9827  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9828  * if not (flags & bufmode):
9829  */
9830  }
9831  __pyx_L3:;
9832 
9833  /* "View.MemoryView":191
9834  * elif self.mode == u"fortran":
9835  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9836  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9837  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9838  * info.buf = self.data
9839  */
9840  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9841  if (unlikely(__pyx_t_1)) {
9842 
9843  /* "View.MemoryView":192
9844  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9845  * if not (flags & bufmode):
9846  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
9847  * info.buf = self.data
9848  * info.len = self.len
9849  */
9850  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 192, __pyx_L1_error)
9851  __Pyx_GOTREF(__pyx_t_3);
9852  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9853  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9854  __PYX_ERR(2, 192, __pyx_L1_error)
9855 
9856  /* "View.MemoryView":191
9857  * elif self.mode == u"fortran":
9858  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9859  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9860  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9861  * info.buf = self.data
9862  */
9863  }
9864 
9865  /* "View.MemoryView":193
9866  * if not (flags & bufmode):
9867  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9868  * info.buf = self.data # <<<<<<<<<<<<<<
9869  * info.len = self.len
9870  * info.ndim = self.ndim
9871  */
9872  __pyx_t_4 = __pyx_v_self->data;
9873  __pyx_v_info->buf = __pyx_t_4;
9874 
9875  /* "View.MemoryView":194
9876  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9877  * info.buf = self.data
9878  * info.len = self.len # <<<<<<<<<<<<<<
9879  * info.ndim = self.ndim
9880  * info.shape = self._shape
9881  */
9882  __pyx_t_5 = __pyx_v_self->len;
9883  __pyx_v_info->len = __pyx_t_5;
9884 
9885  /* "View.MemoryView":195
9886  * info.buf = self.data
9887  * info.len = self.len
9888  * info.ndim = self.ndim # <<<<<<<<<<<<<<
9889  * info.shape = self._shape
9890  * info.strides = self._strides
9891  */
9892  __pyx_t_6 = __pyx_v_self->ndim;
9893  __pyx_v_info->ndim = __pyx_t_6;
9894 
9895  /* "View.MemoryView":196
9896  * info.len = self.len
9897  * info.ndim = self.ndim
9898  * info.shape = self._shape # <<<<<<<<<<<<<<
9899  * info.strides = self._strides
9900  * info.suboffsets = NULL
9901  */
9902  __pyx_t_7 = __pyx_v_self->_shape;
9903  __pyx_v_info->shape = __pyx_t_7;
9904 
9905  /* "View.MemoryView":197
9906  * info.ndim = self.ndim
9907  * info.shape = self._shape
9908  * info.strides = self._strides # <<<<<<<<<<<<<<
9909  * info.suboffsets = NULL
9910  * info.itemsize = self.itemsize
9911  */
9912  __pyx_t_7 = __pyx_v_self->_strides;
9913  __pyx_v_info->strides = __pyx_t_7;
9914 
9915  /* "View.MemoryView":198
9916  * info.shape = self._shape
9917  * info.strides = self._strides
9918  * info.suboffsets = NULL # <<<<<<<<<<<<<<
9919  * info.itemsize = self.itemsize
9920  * info.readonly = 0
9921  */
9922  __pyx_v_info->suboffsets = NULL;
9923 
9924  /* "View.MemoryView":199
9925  * info.strides = self._strides
9926  * info.suboffsets = NULL
9927  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
9928  * info.readonly = 0
9929  *
9930  */
9931  __pyx_t_5 = __pyx_v_self->itemsize;
9932  __pyx_v_info->itemsize = __pyx_t_5;
9933 
9934  /* "View.MemoryView":200
9935  * info.suboffsets = NULL
9936  * info.itemsize = self.itemsize
9937  * info.readonly = 0 # <<<<<<<<<<<<<<
9938  *
9939  * if flags & PyBUF_FORMAT:
9940  */
9941  __pyx_v_info->readonly = 0;
9942 
9943  /* "View.MemoryView":202
9944  * info.readonly = 0
9945  *
9946  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9947  * info.format = self.format
9948  * else:
9949  */
9950  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9951  if (__pyx_t_1) {
9952 
9953  /* "View.MemoryView":203
9954  *
9955  * if flags & PyBUF_FORMAT:
9956  * info.format = self.format # <<<<<<<<<<<<<<
9957  * else:
9958  * info.format = NULL
9959  */
9960  __pyx_t_4 = __pyx_v_self->format;
9961  __pyx_v_info->format = __pyx_t_4;
9962 
9963  /* "View.MemoryView":202
9964  * info.readonly = 0
9965  *
9966  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9967  * info.format = self.format
9968  * else:
9969  */
9970  goto __pyx_L5;
9971  }
9972 
9973  /* "View.MemoryView":205
9974  * info.format = self.format
9975  * else:
9976  * info.format = NULL # <<<<<<<<<<<<<<
9977  *
9978  * info.obj = self
9979  */
9980  /*else*/ {
9981  __pyx_v_info->format = NULL;
9982  }
9983  __pyx_L5:;
9984 
9985  /* "View.MemoryView":207
9986  * info.format = NULL
9987  *
9988  * info.obj = self # <<<<<<<<<<<<<<
9989  *
9990  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9991  */
9992  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9993  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9994  __Pyx_GOTREF(__pyx_v_info->obj);
9995  __Pyx_DECREF(__pyx_v_info->obj);
9996  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9997 
9998  /* "View.MemoryView":185
9999  *
10000  * @cname('getbuffer')
10001  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
10002  * cdef int bufmode = -1
10003  * if self.mode == u"c":
10004  */
10005 
10006  /* function exit code */
10007  __pyx_r = 0;
10008  goto __pyx_L0;
10009  __pyx_L1_error:;
10010  __Pyx_XDECREF(__pyx_t_3);
10011  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10012  __pyx_r = -1;
10013  if (__pyx_v_info->obj != NULL) {
10014  __Pyx_GOTREF(__pyx_v_info->obj);
10015  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10016  }
10017  goto __pyx_L2;
10018  __pyx_L0:;
10019  if (__pyx_v_info->obj == Py_None) {
10020  __Pyx_GOTREF(__pyx_v_info->obj);
10021  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10022  }
10023  __pyx_L2:;
10024  __Pyx_RefNannyFinishContext();
10025  return __pyx_r;
10026 }
10027 
10028 /* "View.MemoryView":211
10029  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
10030  *
10031  * def __dealloc__(array self): # <<<<<<<<<<<<<<
10032  * if self.callback_free_data != NULL:
10033  * self.callback_free_data(self.data)
10034  */
10035 
10036 /* Python wrapper */
10037 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
10038 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
10039  __Pyx_RefNannyDeclarations
10040  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10041  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
10042 
10043  /* function exit code */
10044  __Pyx_RefNannyFinishContext();
10045 }
10046 
10047 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
10048  __Pyx_RefNannyDeclarations
10049  int __pyx_t_1;
10050  __Pyx_RefNannySetupContext("__dealloc__", 0);
10051 
10052  /* "View.MemoryView":212
10053  *
10054  * def __dealloc__(array self):
10055  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
10056  * self.callback_free_data(self.data)
10057  * elif self.free_data:
10058  */
10059  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
10060  if (__pyx_t_1) {
10061 
10062  /* "View.MemoryView":213
10063  * def __dealloc__(array self):
10064  * if self.callback_free_data != NULL:
10065  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
10066  * elif self.free_data:
10067  * if self.dtype_is_object:
10068  */
10069  __pyx_v_self->callback_free_data(__pyx_v_self->data);
10070 
10071  /* "View.MemoryView":212
10072  *
10073  * def __dealloc__(array self):
10074  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
10075  * self.callback_free_data(self.data)
10076  * elif self.free_data:
10077  */
10078  goto __pyx_L3;
10079  }
10080 
10081  /* "View.MemoryView":214
10082  * if self.callback_free_data != NULL:
10083  * self.callback_free_data(self.data)
10084  * elif self.free_data: # <<<<<<<<<<<<<<
10085  * if self.dtype_is_object:
10086  * refcount_objects_in_slice(self.data, self._shape,
10087  */
10088  __pyx_t_1 = (__pyx_v_self->free_data != 0);
10089  if (__pyx_t_1) {
10090 
10091  /* "View.MemoryView":215
10092  * self.callback_free_data(self.data)
10093  * elif self.free_data:
10094  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10095  * refcount_objects_in_slice(self.data, self._shape,
10096  * self._strides, self.ndim, False)
10097  */
10098  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
10099  if (__pyx_t_1) {
10100 
10101  /* "View.MemoryView":216
10102  * elif self.free_data:
10103  * if self.dtype_is_object:
10104  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
10105  * self._strides, self.ndim, False)
10106  * free(self.data)
10107  */
10108  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
10109 
10110  /* "View.MemoryView":215
10111  * self.callback_free_data(self.data)
10112  * elif self.free_data:
10113  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10114  * refcount_objects_in_slice(self.data, self._shape,
10115  * self._strides, self.ndim, False)
10116  */
10117  }
10118 
10119  /* "View.MemoryView":218
10120  * refcount_objects_in_slice(self.data, self._shape,
10121  * self._strides, self.ndim, False)
10122  * free(self.data) # <<<<<<<<<<<<<<
10123  * PyObject_Free(self._shape)
10124  *
10125  */
10126  free(__pyx_v_self->data);
10127 
10128  /* "View.MemoryView":214
10129  * if self.callback_free_data != NULL:
10130  * self.callback_free_data(self.data)
10131  * elif self.free_data: # <<<<<<<<<<<<<<
10132  * if self.dtype_is_object:
10133  * refcount_objects_in_slice(self.data, self._shape,
10134  */
10135  }
10136  __pyx_L3:;
10137 
10138  /* "View.MemoryView":219
10139  * self._strides, self.ndim, False)
10140  * free(self.data)
10141  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
10142  *
10143  * @property
10144  */
10145  PyObject_Free(__pyx_v_self->_shape);
10146 
10147  /* "View.MemoryView":211
10148  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
10149  *
10150  * def __dealloc__(array self): # <<<<<<<<<<<<<<
10151  * if self.callback_free_data != NULL:
10152  * self.callback_free_data(self.data)
10153  */
10154 
10155  /* function exit code */
10156  __Pyx_RefNannyFinishContext();
10157 }
10158 
10159 /* "View.MemoryView":222
10160  *
10161  * @property
10162  * def memview(self): # <<<<<<<<<<<<<<
10163  * return self.get_memview()
10164  *
10165  */
10166 
10167 /* Python wrapper */
10168 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
10169 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
10170  PyObject *__pyx_r = 0;
10171  __Pyx_RefNannyDeclarations
10172  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10173  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
10174 
10175  /* function exit code */
10176  __Pyx_RefNannyFinishContext();
10177  return __pyx_r;
10178 }
10179 
10180 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
10181  PyObject *__pyx_r = NULL;
10182  __Pyx_RefNannyDeclarations
10183  PyObject *__pyx_t_1 = NULL;
10184  __Pyx_RefNannySetupContext("__get__", 0);
10185 
10186  /* "View.MemoryView":223
10187  * @property
10188  * def memview(self):
10189  * return self.get_memview() # <<<<<<<<<<<<<<
10190  *
10191  * @cname('get_memview')
10192  */
10193  __Pyx_XDECREF(__pyx_r);
10194  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error)
10195  __Pyx_GOTREF(__pyx_t_1);
10196  __pyx_r = __pyx_t_1;
10197  __pyx_t_1 = 0;
10198  goto __pyx_L0;
10199 
10200  /* "View.MemoryView":222
10201  *
10202  * @property
10203  * def memview(self): # <<<<<<<<<<<<<<
10204  * return self.get_memview()
10205  *
10206  */
10207 
10208  /* function exit code */
10209  __pyx_L1_error:;
10210  __Pyx_XDECREF(__pyx_t_1);
10211  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10212  __pyx_r = NULL;
10213  __pyx_L0:;
10214  __Pyx_XGIVEREF(__pyx_r);
10215  __Pyx_RefNannyFinishContext();
10216  return __pyx_r;
10217 }
10218 
10219 /* "View.MemoryView":226
10220  *
10221  * @cname('get_memview')
10222  * cdef get_memview(self): # <<<<<<<<<<<<<<
10223  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10224  * return memoryview(self, flags, self.dtype_is_object)
10225  */
10226 
10227 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
10228  int __pyx_v_flags;
10229  PyObject *__pyx_r = NULL;
10230  __Pyx_RefNannyDeclarations
10231  PyObject *__pyx_t_1 = NULL;
10232  PyObject *__pyx_t_2 = NULL;
10233  PyObject *__pyx_t_3 = NULL;
10234  __Pyx_RefNannySetupContext("get_memview", 0);
10235 
10236  /* "View.MemoryView":227
10237  * @cname('get_memview')
10238  * cdef get_memview(self):
10239  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
10240  * return memoryview(self, flags, self.dtype_is_object)
10241  *
10242  */
10243  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
10244 
10245  /* "View.MemoryView":228
10246  * cdef get_memview(self):
10247  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10248  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
10249  *
10250  * def __len__(self):
10251  */
10252  __Pyx_XDECREF(__pyx_r);
10253  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error)
10254  __Pyx_GOTREF(__pyx_t_1);
10255  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
10256  __Pyx_GOTREF(__pyx_t_2);
10257  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 228, __pyx_L1_error)
10258  __Pyx_GOTREF(__pyx_t_3);
10259  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10260  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10261  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
10262  __Pyx_GIVEREF(__pyx_t_1);
10263  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
10264  __Pyx_GIVEREF(__pyx_t_2);
10265  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
10266  __pyx_t_1 = 0;
10267  __pyx_t_2 = 0;
10268  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
10269  __Pyx_GOTREF(__pyx_t_2);
10270  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10271  __pyx_r = __pyx_t_2;
10272  __pyx_t_2 = 0;
10273  goto __pyx_L0;
10274 
10275  /* "View.MemoryView":226
10276  *
10277  * @cname('get_memview')
10278  * cdef get_memview(self): # <<<<<<<<<<<<<<
10279  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10280  * return memoryview(self, flags, self.dtype_is_object)
10281  */
10282 
10283  /* function exit code */
10284  __pyx_L1_error:;
10285  __Pyx_XDECREF(__pyx_t_1);
10286  __Pyx_XDECREF(__pyx_t_2);
10287  __Pyx_XDECREF(__pyx_t_3);
10288  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
10289  __pyx_r = 0;
10290  __pyx_L0:;
10291  __Pyx_XGIVEREF(__pyx_r);
10292  __Pyx_RefNannyFinishContext();
10293  return __pyx_r;
10294 }
10295 
10296 /* "View.MemoryView":230
10297  * return memoryview(self, flags, self.dtype_is_object)
10298  *
10299  * def __len__(self): # <<<<<<<<<<<<<<
10300  * return self._shape[0]
10301  *
10302  */
10303 
10304 /* Python wrapper */
10305 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
10306 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
10307  Py_ssize_t __pyx_r;
10308  __Pyx_RefNannyDeclarations
10309  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
10310  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
10311 
10312  /* function exit code */
10313  __Pyx_RefNannyFinishContext();
10314  return __pyx_r;
10315 }
10316 
10317 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
10318  Py_ssize_t __pyx_r;
10319  __Pyx_RefNannyDeclarations
10320  __Pyx_RefNannySetupContext("__len__", 0);
10321 
10322  /* "View.MemoryView":231
10323  *
10324  * def __len__(self):
10325  * return self._shape[0] # <<<<<<<<<<<<<<
10326  *
10327  * def __getattr__(self, attr):
10328  */
10329  __pyx_r = (__pyx_v_self->_shape[0]);
10330  goto __pyx_L0;
10331 
10332  /* "View.MemoryView":230
10333  * return memoryview(self, flags, self.dtype_is_object)
10334  *
10335  * def __len__(self): # <<<<<<<<<<<<<<
10336  * return self._shape[0]
10337  *
10338  */
10339 
10340  /* function exit code */
10341  __pyx_L0:;
10342  __Pyx_RefNannyFinishContext();
10343  return __pyx_r;
10344 }
10345 
10346 /* "View.MemoryView":233
10347  * return self._shape[0]
10348  *
10349  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
10350  * return getattr(self.memview, attr)
10351  *
10352  */
10353 
10354 /* Python wrapper */
10355 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
10356 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
10357  PyObject *__pyx_r = 0;
10358  __Pyx_RefNannyDeclarations
10359  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
10360  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
10361 
10362  /* function exit code */
10363  __Pyx_RefNannyFinishContext();
10364  return __pyx_r;
10365 }
10366 
10367 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
10368  PyObject *__pyx_r = NULL;
10369  __Pyx_RefNannyDeclarations
10370  PyObject *__pyx_t_1 = NULL;
10371  PyObject *__pyx_t_2 = NULL;
10372  __Pyx_RefNannySetupContext("__getattr__", 0);
10373 
10374  /* "View.MemoryView":234
10375  *
10376  * def __getattr__(self, attr):
10377  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
10378  *
10379  * def __getitem__(self, item):
10380  */
10381  __Pyx_XDECREF(__pyx_r);
10382  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error)
10383  __Pyx_GOTREF(__pyx_t_1);
10384  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error)
10385  __Pyx_GOTREF(__pyx_t_2);
10386  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10387  __pyx_r = __pyx_t_2;
10388  __pyx_t_2 = 0;
10389  goto __pyx_L0;
10390 
10391  /* "View.MemoryView":233
10392  * return self._shape[0]
10393  *
10394  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
10395  * return getattr(self.memview, attr)
10396  *
10397  */
10398 
10399  /* function exit code */
10400  __pyx_L1_error:;
10401  __Pyx_XDECREF(__pyx_t_1);
10402  __Pyx_XDECREF(__pyx_t_2);
10403  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10404  __pyx_r = NULL;
10405  __pyx_L0:;
10406  __Pyx_XGIVEREF(__pyx_r);
10407  __Pyx_RefNannyFinishContext();
10408  return __pyx_r;
10409 }
10410 
10411 /* "View.MemoryView":236
10412  * return getattr(self.memview, attr)
10413  *
10414  * def __getitem__(self, item): # <<<<<<<<<<<<<<
10415  * return self.memview[item]
10416  *
10417  */
10418 
10419 /* Python wrapper */
10420 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
10421 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
10422  PyObject *__pyx_r = 0;
10423  __Pyx_RefNannyDeclarations
10424  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10425  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
10426 
10427  /* function exit code */
10428  __Pyx_RefNannyFinishContext();
10429  return __pyx_r;
10430 }
10431 
10432 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
10433  PyObject *__pyx_r = NULL;
10434  __Pyx_RefNannyDeclarations
10435  PyObject *__pyx_t_1 = NULL;
10436  PyObject *__pyx_t_2 = NULL;
10437  __Pyx_RefNannySetupContext("__getitem__", 0);
10438 
10439  /* "View.MemoryView":237
10440  *
10441  * def __getitem__(self, item):
10442  * return self.memview[item] # <<<<<<<<<<<<<<
10443  *
10444  * def __setitem__(self, item, value):
10445  */
10446  __Pyx_XDECREF(__pyx_r);
10447  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error)
10448  __Pyx_GOTREF(__pyx_t_1);
10449  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error)
10450  __Pyx_GOTREF(__pyx_t_2);
10451  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10452  __pyx_r = __pyx_t_2;
10453  __pyx_t_2 = 0;
10454  goto __pyx_L0;
10455 
10456  /* "View.MemoryView":236
10457  * return getattr(self.memview, attr)
10458  *
10459  * def __getitem__(self, item): # <<<<<<<<<<<<<<
10460  * return self.memview[item]
10461  *
10462  */
10463 
10464  /* function exit code */
10465  __pyx_L1_error:;
10466  __Pyx_XDECREF(__pyx_t_1);
10467  __Pyx_XDECREF(__pyx_t_2);
10468  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10469  __pyx_r = NULL;
10470  __pyx_L0:;
10471  __Pyx_XGIVEREF(__pyx_r);
10472  __Pyx_RefNannyFinishContext();
10473  return __pyx_r;
10474 }
10475 
10476 /* "View.MemoryView":239
10477  * return self.memview[item]
10478  *
10479  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
10480  * self.memview[item] = value
10481  *
10482  */
10483 
10484 /* Python wrapper */
10485 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
10486 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10487  int __pyx_r;
10488  __Pyx_RefNannyDeclarations
10489  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
10490  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
10491 
10492  /* function exit code */
10493  __Pyx_RefNannyFinishContext();
10494  return __pyx_r;
10495 }
10496 
10497 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10498  int __pyx_r;
10499  __Pyx_RefNannyDeclarations
10500  PyObject *__pyx_t_1 = NULL;
10501  __Pyx_RefNannySetupContext("__setitem__", 0);
10502 
10503  /* "View.MemoryView":240
10504  *
10505  * def __setitem__(self, item, value):
10506  * self.memview[item] = value # <<<<<<<<<<<<<<
10507  *
10508  *
10509  */
10510  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error)
10511  __Pyx_GOTREF(__pyx_t_1);
10512  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 240, __pyx_L1_error)
10513  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10514 
10515  /* "View.MemoryView":239
10516  * return self.memview[item]
10517  *
10518  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
10519  * self.memview[item] = value
10520  *
10521  */
10522 
10523  /* function exit code */
10524  __pyx_r = 0;
10525  goto __pyx_L0;
10526  __pyx_L1_error:;
10527  __Pyx_XDECREF(__pyx_t_1);
10528  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10529  __pyx_r = -1;
10530  __pyx_L0:;
10531  __Pyx_RefNannyFinishContext();
10532  return __pyx_r;
10533 }
10534 
10535 /* "(tree fragment)":1
10536  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10537  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10538  * def __setstate_cython__(self, __pyx_state):
10539  */
10540 
10541 /* Python wrapper */
10542 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10543 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10544  PyObject *__pyx_r = 0;
10545  __Pyx_RefNannyDeclarations
10546  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10547  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
10548 
10549  /* function exit code */
10550  __Pyx_RefNannyFinishContext();
10551  return __pyx_r;
10552 }
10553 
10554 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
10555  PyObject *__pyx_r = NULL;
10556  __Pyx_RefNannyDeclarations
10557  PyObject *__pyx_t_1 = NULL;
10558  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10559 
10560  /* "(tree fragment)":2
10561  * def __reduce_cython__(self):
10562  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10563  * def __setstate_cython__(self, __pyx_state):
10564  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10565  */
10566  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
10567  __Pyx_GOTREF(__pyx_t_1);
10568  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10569  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10570  __PYX_ERR(2, 2, __pyx_L1_error)
10571 
10572  /* "(tree fragment)":1
10573  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10574  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10575  * def __setstate_cython__(self, __pyx_state):
10576  */
10577 
10578  /* function exit code */
10579  __pyx_L1_error:;
10580  __Pyx_XDECREF(__pyx_t_1);
10581  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10582  __pyx_r = NULL;
10583  __Pyx_XGIVEREF(__pyx_r);
10584  __Pyx_RefNannyFinishContext();
10585  return __pyx_r;
10586 }
10587 
10588 /* "(tree fragment)":3
10589  * def __reduce_cython__(self):
10590  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10591  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10592  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10593  */
10594 
10595 /* Python wrapper */
10596 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10597 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10598  PyObject *__pyx_r = 0;
10599  __Pyx_RefNannyDeclarations
10600  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10601  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10602 
10603  /* function exit code */
10604  __Pyx_RefNannyFinishContext();
10605  return __pyx_r;
10606 }
10607 
10608 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10609  PyObject *__pyx_r = NULL;
10610  __Pyx_RefNannyDeclarations
10611  PyObject *__pyx_t_1 = NULL;
10612  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10613 
10614  /* "(tree fragment)":4
10615  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10616  * def __setstate_cython__(self, __pyx_state):
10617  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10618  */
10619  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
10620  __Pyx_GOTREF(__pyx_t_1);
10621  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10622  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10623  __PYX_ERR(2, 4, __pyx_L1_error)
10624 
10625  /* "(tree fragment)":3
10626  * def __reduce_cython__(self):
10627  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10628  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10629  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10630  */
10631 
10632  /* function exit code */
10633  __pyx_L1_error:;
10634  __Pyx_XDECREF(__pyx_t_1);
10635  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10636  __pyx_r = NULL;
10637  __Pyx_XGIVEREF(__pyx_r);
10638  __Pyx_RefNannyFinishContext();
10639  return __pyx_r;
10640 }
10641 
10642 /* "View.MemoryView":244
10643  *
10644  * @cname("__pyx_array_new")
10645  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10646  * char *mode, char *buf):
10647  * cdef array result
10648  */
10649 
10650 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
10651  struct __pyx_array_obj *__pyx_v_result = 0;
10652  struct __pyx_array_obj *__pyx_r = NULL;
10653  __Pyx_RefNannyDeclarations
10654  int __pyx_t_1;
10655  PyObject *__pyx_t_2 = NULL;
10656  PyObject *__pyx_t_3 = NULL;
10657  PyObject *__pyx_t_4 = NULL;
10658  PyObject *__pyx_t_5 = NULL;
10659  __Pyx_RefNannySetupContext("array_cwrapper", 0);
10660 
10661  /* "View.MemoryView":248
10662  * cdef array result
10663  *
10664  * if buf == NULL: # <<<<<<<<<<<<<<
10665  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10666  * else:
10667  */
10668  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10669  if (__pyx_t_1) {
10670 
10671  /* "View.MemoryView":249
10672  *
10673  * if buf == NULL:
10674  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
10675  * else:
10676  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10677  */
10678  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 249, __pyx_L1_error)
10679  __Pyx_GOTREF(__pyx_t_2);
10680  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 249, __pyx_L1_error)
10681  __Pyx_GOTREF(__pyx_t_3);
10682  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
10683  __Pyx_GOTREF(__pyx_t_4);
10684  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error)
10685  __Pyx_GOTREF(__pyx_t_5);
10686  __Pyx_INCREF(__pyx_v_shape);
10687  __Pyx_GIVEREF(__pyx_v_shape);
10688  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10689  __Pyx_GIVEREF(__pyx_t_2);
10690  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10691  __Pyx_GIVEREF(__pyx_t_3);
10692  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10693  __Pyx_GIVEREF(__pyx_t_4);
10694  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10695  __pyx_t_2 = 0;
10696  __pyx_t_3 = 0;
10697  __pyx_t_4 = 0;
10698  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
10699  __Pyx_GOTREF(__pyx_t_4);
10700  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10701  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
10702  __pyx_t_4 = 0;
10703 
10704  /* "View.MemoryView":248
10705  * cdef array result
10706  *
10707  * if buf == NULL: # <<<<<<<<<<<<<<
10708  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10709  * else:
10710  */
10711  goto __pyx_L3;
10712  }
10713 
10714  /* "View.MemoryView":251
10715  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10716  * else:
10717  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10718  * allocate_buffer=False)
10719  * result.data = buf
10720  */
10721  /*else*/ {
10722  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 251, __pyx_L1_error)
10723  __Pyx_GOTREF(__pyx_t_4);
10724  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
10725  __Pyx_GOTREF(__pyx_t_5);
10726  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 251, __pyx_L1_error)
10727  __Pyx_GOTREF(__pyx_t_3);
10728  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error)
10729  __Pyx_GOTREF(__pyx_t_2);
10730  __Pyx_INCREF(__pyx_v_shape);
10731  __Pyx_GIVEREF(__pyx_v_shape);
10732  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10733  __Pyx_GIVEREF(__pyx_t_4);
10734  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10735  __Pyx_GIVEREF(__pyx_t_5);
10736  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10737  __Pyx_GIVEREF(__pyx_t_3);
10738  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10739  __pyx_t_4 = 0;
10740  __pyx_t_5 = 0;
10741  __pyx_t_3 = 0;
10742 
10743  /* "View.MemoryView":252
10744  * else:
10745  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10746  * allocate_buffer=False) # <<<<<<<<<<<<<<
10747  * result.data = buf
10748  *
10749  */
10750  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error)
10751  __Pyx_GOTREF(__pyx_t_3);
10752  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 252, __pyx_L1_error)
10753 
10754  /* "View.MemoryView":251
10755  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10756  * else:
10757  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10758  * allocate_buffer=False)
10759  * result.data = buf
10760  */
10761  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
10762  __Pyx_GOTREF(__pyx_t_5);
10763  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10764  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10765  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
10766  __pyx_t_5 = 0;
10767 
10768  /* "View.MemoryView":253
10769  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10770  * allocate_buffer=False)
10771  * result.data = buf # <<<<<<<<<<<<<<
10772  *
10773  * return result
10774  */
10775  __pyx_v_result->data = __pyx_v_buf;
10776  }
10777  __pyx_L3:;
10778 
10779  /* "View.MemoryView":255
10780  * result.data = buf
10781  *
10782  * return result # <<<<<<<<<<<<<<
10783  *
10784  *
10785  */
10786  __Pyx_XDECREF(((PyObject *)__pyx_r));
10787  __Pyx_INCREF(((PyObject *)__pyx_v_result));
10788  __pyx_r = __pyx_v_result;
10789  goto __pyx_L0;
10790 
10791  /* "View.MemoryView":244
10792  *
10793  * @cname("__pyx_array_new")
10794  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10795  * char *mode, char *buf):
10796  * cdef array result
10797  */
10798 
10799  /* function exit code */
10800  __pyx_L1_error:;
10801  __Pyx_XDECREF(__pyx_t_2);
10802  __Pyx_XDECREF(__pyx_t_3);
10803  __Pyx_XDECREF(__pyx_t_4);
10804  __Pyx_XDECREF(__pyx_t_5);
10805  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10806  __pyx_r = 0;
10807  __pyx_L0:;
10808  __Pyx_XDECREF((PyObject *)__pyx_v_result);
10809  __Pyx_XGIVEREF((PyObject *)__pyx_r);
10810  __Pyx_RefNannyFinishContext();
10811  return __pyx_r;
10812 }
10813 
10814 /* "View.MemoryView":281
10815  * cdef class Enum(object):
10816  * cdef object name
10817  * def __init__(self, name): # <<<<<<<<<<<<<<
10818  * self.name = name
10819  * def __repr__(self):
10820  */
10821 
10822 /* Python wrapper */
10823 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10824 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10825  PyObject *__pyx_v_name = 0;
10826  int __pyx_r;
10827  __Pyx_RefNannyDeclarations
10828  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
10829  {
10830  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10831  PyObject* values[1] = {0};
10832  if (unlikely(__pyx_kwds)) {
10833  Py_ssize_t kw_args;
10834  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10835  switch (pos_args) {
10836  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10837  CYTHON_FALLTHROUGH;
10838  case 0: break;
10839  default: goto __pyx_L5_argtuple_error;
10840  }
10841  kw_args = PyDict_Size(__pyx_kwds);
10842  switch (pos_args) {
10843  case 0:
10844  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10845  else goto __pyx_L5_argtuple_error;
10846  }
10847  if (unlikely(kw_args > 0)) {
10848  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 281, __pyx_L3_error)
10849  }
10850  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10851  goto __pyx_L5_argtuple_error;
10852  } else {
10853  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10854  }
10855  __pyx_v_name = values[0];
10856  }
10857  goto __pyx_L4_argument_unpacking_done;
10858  __pyx_L5_argtuple_error:;
10859  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 281, __pyx_L3_error)
10860  __pyx_L3_error:;
10861  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10862  __Pyx_RefNannyFinishContext();
10863  return -1;
10864  __pyx_L4_argument_unpacking_done:;
10865  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10866 
10867  /* function exit code */
10868  __Pyx_RefNannyFinishContext();
10869  return __pyx_r;
10870 }
10871 
10872 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10873  int __pyx_r;
10874  __Pyx_RefNannyDeclarations
10875  __Pyx_RefNannySetupContext("__init__", 0);
10876 
10877  /* "View.MemoryView":282
10878  * cdef object name
10879  * def __init__(self, name):
10880  * self.name = name # <<<<<<<<<<<<<<
10881  * def __repr__(self):
10882  * return self.name
10883  */
10884  __Pyx_INCREF(__pyx_v_name);
10885  __Pyx_GIVEREF(__pyx_v_name);
10886  __Pyx_GOTREF(__pyx_v_self->name);
10887  __Pyx_DECREF(__pyx_v_self->name);
10888  __pyx_v_self->name = __pyx_v_name;
10889 
10890  /* "View.MemoryView":281
10891  * cdef class Enum(object):
10892  * cdef object name
10893  * def __init__(self, name): # <<<<<<<<<<<<<<
10894  * self.name = name
10895  * def __repr__(self):
10896  */
10897 
10898  /* function exit code */
10899  __pyx_r = 0;
10900  __Pyx_RefNannyFinishContext();
10901  return __pyx_r;
10902 }
10903 
10904 /* "View.MemoryView":283
10905  * def __init__(self, name):
10906  * self.name = name
10907  * def __repr__(self): # <<<<<<<<<<<<<<
10908  * return self.name
10909  *
10910  */
10911 
10912 /* Python wrapper */
10913 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
10914 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10915  PyObject *__pyx_r = 0;
10916  __Pyx_RefNannyDeclarations
10917  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10918  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10919 
10920  /* function exit code */
10921  __Pyx_RefNannyFinishContext();
10922  return __pyx_r;
10923 }
10924 
10925 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10926  PyObject *__pyx_r = NULL;
10927  __Pyx_RefNannyDeclarations
10928  __Pyx_RefNannySetupContext("__repr__", 0);
10929 
10930  /* "View.MemoryView":284
10931  * self.name = name
10932  * def __repr__(self):
10933  * return self.name # <<<<<<<<<<<<<<
10934  *
10935  * cdef generic = Enum("<strided and direct or indirect>")
10936  */
10937  __Pyx_XDECREF(__pyx_r);
10938  __Pyx_INCREF(__pyx_v_self->name);
10939  __pyx_r = __pyx_v_self->name;
10940  goto __pyx_L0;
10941 
10942  /* "View.MemoryView":283
10943  * def __init__(self, name):
10944  * self.name = name
10945  * def __repr__(self): # <<<<<<<<<<<<<<
10946  * return self.name
10947  *
10948  */
10949 
10950  /* function exit code */
10951  __pyx_L0:;
10952  __Pyx_XGIVEREF(__pyx_r);
10953  __Pyx_RefNannyFinishContext();
10954  return __pyx_r;
10955 }
10956 
10957 /* "(tree fragment)":1
10958  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10959  * cdef tuple state
10960  * cdef object _dict
10961  */
10962 
10963 /* Python wrapper */
10964 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10965 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10966  PyObject *__pyx_r = 0;
10967  __Pyx_RefNannyDeclarations
10968  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10969  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10970 
10971  /* function exit code */
10972  __Pyx_RefNannyFinishContext();
10973  return __pyx_r;
10974 }
10975 
10976 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10977  PyObject *__pyx_v_state = 0;
10978  PyObject *__pyx_v__dict = 0;
10979  int __pyx_v_use_setstate;
10980  PyObject *__pyx_r = NULL;
10981  __Pyx_RefNannyDeclarations
10982  PyObject *__pyx_t_1 = NULL;
10983  int __pyx_t_2;
10984  int __pyx_t_3;
10985  PyObject *__pyx_t_4 = NULL;
10986  PyObject *__pyx_t_5 = NULL;
10987  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10988 
10989  /* "(tree fragment)":5
10990  * cdef object _dict
10991  * cdef bint use_setstate
10992  * state = (self.name,) # <<<<<<<<<<<<<<
10993  * _dict = getattr(self, '__dict__', None)
10994  * if _dict is not None:
10995  */
10996  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
10997  __Pyx_GOTREF(__pyx_t_1);
10998  __Pyx_INCREF(__pyx_v_self->name);
10999  __Pyx_GIVEREF(__pyx_v_self->name);
11000  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
11001  __pyx_v_state = ((PyObject*)__pyx_t_1);
11002  __pyx_t_1 = 0;
11003 
11004  /* "(tree fragment)":6
11005  * cdef bint use_setstate
11006  * state = (self.name,)
11007  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
11008  * if _dict is not None:
11009  * state += (_dict,)
11010  */
11011  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
11012  __Pyx_GOTREF(__pyx_t_1);
11013  __pyx_v__dict = __pyx_t_1;
11014  __pyx_t_1 = 0;
11015 
11016  /* "(tree fragment)":7
11017  * state = (self.name,)
11018  * _dict = getattr(self, '__dict__', None)
11019  * if _dict is not None: # <<<<<<<<<<<<<<
11020  * state += (_dict,)
11021  * use_setstate = True
11022  */
11023  __pyx_t_2 = (__pyx_v__dict != Py_None);
11024  __pyx_t_3 = (__pyx_t_2 != 0);
11025  if (__pyx_t_3) {
11026 
11027  /* "(tree fragment)":8
11028  * _dict = getattr(self, '__dict__', None)
11029  * if _dict is not None:
11030  * state += (_dict,) # <<<<<<<<<<<<<<
11031  * use_setstate = True
11032  * else:
11033  */
11034  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
11035  __Pyx_GOTREF(__pyx_t_1);
11036  __Pyx_INCREF(__pyx_v__dict);
11037  __Pyx_GIVEREF(__pyx_v__dict);
11038  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
11039  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
11040  __Pyx_GOTREF(__pyx_t_4);
11041  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11042  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
11043  __pyx_t_4 = 0;
11044 
11045  /* "(tree fragment)":9
11046  * if _dict is not None:
11047  * state += (_dict,)
11048  * use_setstate = True # <<<<<<<<<<<<<<
11049  * else:
11050  * use_setstate = self.name is not None
11051  */
11052  __pyx_v_use_setstate = 1;
11053 
11054  /* "(tree fragment)":7
11055  * state = (self.name,)
11056  * _dict = getattr(self, '__dict__', None)
11057  * if _dict is not None: # <<<<<<<<<<<<<<
11058  * state += (_dict,)
11059  * use_setstate = True
11060  */
11061  goto __pyx_L3;
11062  }
11063 
11064  /* "(tree fragment)":11
11065  * use_setstate = True
11066  * else:
11067  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
11068  * if use_setstate:
11069  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11070  */
11071  /*else*/ {
11072  __pyx_t_3 = (__pyx_v_self->name != Py_None);
11073  __pyx_v_use_setstate = __pyx_t_3;
11074  }
11075  __pyx_L3:;
11076 
11077  /* "(tree fragment)":12
11078  * else:
11079  * use_setstate = self.name is not None
11080  * if use_setstate: # <<<<<<<<<<<<<<
11081  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11082  * else:
11083  */
11084  __pyx_t_3 = (__pyx_v_use_setstate != 0);
11085  if (__pyx_t_3) {
11086 
11087  /* "(tree fragment)":13
11088  * use_setstate = self.name is not None
11089  * if use_setstate:
11090  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
11091  * else:
11092  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11093  */
11094  __Pyx_XDECREF(__pyx_r);
11095  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
11096  __Pyx_GOTREF(__pyx_t_4);
11097  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
11098  __Pyx_GOTREF(__pyx_t_1);
11099  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11100  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11101  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11102  __Pyx_INCREF(__pyx_int_184977713);
11103  __Pyx_GIVEREF(__pyx_int_184977713);
11104  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11105  __Pyx_INCREF(Py_None);
11106  __Pyx_GIVEREF(Py_None);
11107  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
11108  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
11109  __Pyx_GOTREF(__pyx_t_5);
11110  __Pyx_GIVEREF(__pyx_t_4);
11111  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11112  __Pyx_GIVEREF(__pyx_t_1);
11113  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
11114  __Pyx_INCREF(__pyx_v_state);
11115  __Pyx_GIVEREF(__pyx_v_state);
11116  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
11117  __pyx_t_4 = 0;
11118  __pyx_t_1 = 0;
11119  __pyx_r = __pyx_t_5;
11120  __pyx_t_5 = 0;
11121  goto __pyx_L0;
11122 
11123  /* "(tree fragment)":12
11124  * else:
11125  * use_setstate = self.name is not None
11126  * if use_setstate: # <<<<<<<<<<<<<<
11127  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11128  * else:
11129  */
11130  }
11131 
11132  /* "(tree fragment)":15
11133  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11134  * else:
11135  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
11136  * def __setstate_cython__(self, __pyx_state):
11137  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11138  */
11139  /*else*/ {
11140  __Pyx_XDECREF(__pyx_r);
11141  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
11142  __Pyx_GOTREF(__pyx_t_5);
11143  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
11144  __Pyx_GOTREF(__pyx_t_1);
11145  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11146  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11147  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11148  __Pyx_INCREF(__pyx_int_184977713);
11149  __Pyx_GIVEREF(__pyx_int_184977713);
11150  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11151  __Pyx_INCREF(__pyx_v_state);
11152  __Pyx_GIVEREF(__pyx_v_state);
11153  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
11154  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
11155  __Pyx_GOTREF(__pyx_t_4);
11156  __Pyx_GIVEREF(__pyx_t_5);
11157  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
11158  __Pyx_GIVEREF(__pyx_t_1);
11159  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
11160  __pyx_t_5 = 0;
11161  __pyx_t_1 = 0;
11162  __pyx_r = __pyx_t_4;
11163  __pyx_t_4 = 0;
11164  goto __pyx_L0;
11165  }
11166 
11167  /* "(tree fragment)":1
11168  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11169  * cdef tuple state
11170  * cdef object _dict
11171  */
11172 
11173  /* function exit code */
11174  __pyx_L1_error:;
11175  __Pyx_XDECREF(__pyx_t_1);
11176  __Pyx_XDECREF(__pyx_t_4);
11177  __Pyx_XDECREF(__pyx_t_5);
11178  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11179  __pyx_r = NULL;
11180  __pyx_L0:;
11181  __Pyx_XDECREF(__pyx_v_state);
11182  __Pyx_XDECREF(__pyx_v__dict);
11183  __Pyx_XGIVEREF(__pyx_r);
11184  __Pyx_RefNannyFinishContext();
11185  return __pyx_r;
11186 }
11187 
11188 /* "(tree fragment)":16
11189  * else:
11190  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11191  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11192  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11193  */
11194 
11195 /* Python wrapper */
11196 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
11197 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11198  PyObject *__pyx_r = 0;
11199  __Pyx_RefNannyDeclarations
11200  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11201  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11202 
11203  /* function exit code */
11204  __Pyx_RefNannyFinishContext();
11205  return __pyx_r;
11206 }
11207 
11208 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11209  PyObject *__pyx_r = NULL;
11210  __Pyx_RefNannyDeclarations
11211  PyObject *__pyx_t_1 = NULL;
11212  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11213 
11214  /* "(tree fragment)":17
11215  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11216  * def __setstate_cython__(self, __pyx_state):
11217  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
11218  */
11219  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
11220  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
11221  __Pyx_GOTREF(__pyx_t_1);
11222  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11223 
11224  /* "(tree fragment)":16
11225  * else:
11226  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11227  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11228  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11229  */
11230 
11231  /* function exit code */
11232  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11233  goto __pyx_L0;
11234  __pyx_L1_error:;
11235  __Pyx_XDECREF(__pyx_t_1);
11236  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11237  __pyx_r = NULL;
11238  __pyx_L0:;
11239  __Pyx_XGIVEREF(__pyx_r);
11240  __Pyx_RefNannyFinishContext();
11241  return __pyx_r;
11242 }
11243 
11244 /* "View.MemoryView":298
11245  *
11246  * @cname('__pyx_align_pointer')
11247  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
11248  * "Align pointer memory on a given boundary"
11249  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
11250  */
11251 
11252 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
11253  Py_intptr_t __pyx_v_aligned_p;
11254  size_t __pyx_v_offset;
11255  void *__pyx_r;
11256  int __pyx_t_1;
11257 
11258  /* "View.MemoryView":300
11259  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
11260  * "Align pointer memory on a given boundary"
11261  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
11262  * cdef size_t offset
11263  *
11264  */
11265  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
11266 
11267  /* "View.MemoryView":304
11268  *
11269  * with cython.cdivision(True):
11270  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
11271  *
11272  * if offset > 0:
11273  */
11274  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
11275 
11276  /* "View.MemoryView":306
11277  * offset = aligned_p % alignment
11278  *
11279  * if offset > 0: # <<<<<<<<<<<<<<
11280  * aligned_p += alignment - offset
11281  *
11282  */
11283  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
11284  if (__pyx_t_1) {
11285 
11286  /* "View.MemoryView":307
11287  *
11288  * if offset > 0:
11289  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
11290  *
11291  * return <void *> aligned_p
11292  */
11293  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
11294 
11295  /* "View.MemoryView":306
11296  * offset = aligned_p % alignment
11297  *
11298  * if offset > 0: # <<<<<<<<<<<<<<
11299  * aligned_p += alignment - offset
11300  *
11301  */
11302  }
11303 
11304  /* "View.MemoryView":309
11305  * aligned_p += alignment - offset
11306  *
11307  * return <void *> aligned_p # <<<<<<<<<<<<<<
11308  *
11309  *
11310  */
11311  __pyx_r = ((void *)__pyx_v_aligned_p);
11312  goto __pyx_L0;
11313 
11314  /* "View.MemoryView":298
11315  *
11316  * @cname('__pyx_align_pointer')
11317  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
11318  * "Align pointer memory on a given boundary"
11319  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
11320  */
11321 
11322  /* function exit code */
11323  __pyx_L0:;
11324  return __pyx_r;
11325 }
11326 
11327 /* "View.MemoryView":345
11328  * cdef __Pyx_TypeInfo *typeinfo
11329  *
11330  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11331  * self.obj = obj
11332  * self.flags = flags
11333  */
11334 
11335 /* Python wrapper */
11336 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11337 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11338  PyObject *__pyx_v_obj = 0;
11339  int __pyx_v_flags;
11340  int __pyx_v_dtype_is_object;
11341  int __pyx_r;
11342  __Pyx_RefNannyDeclarations
11343  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
11344  {
11345  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
11346  PyObject* values[3] = {0,0,0};
11347  if (unlikely(__pyx_kwds)) {
11348  Py_ssize_t kw_args;
11349  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11350  switch (pos_args) {
11351  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11352  CYTHON_FALLTHROUGH;
11353  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11354  CYTHON_FALLTHROUGH;
11355  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11356  CYTHON_FALLTHROUGH;
11357  case 0: break;
11358  default: goto __pyx_L5_argtuple_error;
11359  }
11360  kw_args = PyDict_Size(__pyx_kwds);
11361  switch (pos_args) {
11362  case 0:
11363  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
11364  else goto __pyx_L5_argtuple_error;
11365  CYTHON_FALLTHROUGH;
11366  case 1:
11367  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
11368  else {
11369  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 345, __pyx_L3_error)
11370  }
11371  CYTHON_FALLTHROUGH;
11372  case 2:
11373  if (kw_args > 0) {
11374  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
11375  if (value) { values[2] = value; kw_args--; }
11376  }
11377  }
11378  if (unlikely(kw_args > 0)) {
11379  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 345, __pyx_L3_error)
11380  }
11381  } else {
11382  switch (PyTuple_GET_SIZE(__pyx_args)) {
11383  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11384  CYTHON_FALLTHROUGH;
11385  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11386  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11387  break;
11388  default: goto __pyx_L5_argtuple_error;
11389  }
11390  }
11391  __pyx_v_obj = values[0];
11392  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
11393  if (values[2]) {
11394  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
11395  } else {
11396  __pyx_v_dtype_is_object = ((int)0);
11397  }
11398  }
11399  goto __pyx_L4_argument_unpacking_done;
11400  __pyx_L5_argtuple_error:;
11401  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 345, __pyx_L3_error)
11402  __pyx_L3_error:;
11403  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11404  __Pyx_RefNannyFinishContext();
11405  return -1;
11406  __pyx_L4_argument_unpacking_done:;
11407  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
11408 
11409  /* function exit code */
11410  __Pyx_RefNannyFinishContext();
11411  return __pyx_r;
11412 }
11413 
11414 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
11415  int __pyx_r;
11416  __Pyx_RefNannyDeclarations
11417  int __pyx_t_1;
11418  int __pyx_t_2;
11419  int __pyx_t_3;
11420  int __pyx_t_4;
11421  __Pyx_RefNannySetupContext("__cinit__", 0);
11422 
11423  /* "View.MemoryView":346
11424  *
11425  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
11426  * self.obj = obj # <<<<<<<<<<<<<<
11427  * self.flags = flags
11428  * if type(self) is memoryview or obj is not None:
11429  */
11430  __Pyx_INCREF(__pyx_v_obj);
11431  __Pyx_GIVEREF(__pyx_v_obj);
11432  __Pyx_GOTREF(__pyx_v_self->obj);
11433  __Pyx_DECREF(__pyx_v_self->obj);
11434  __pyx_v_self->obj = __pyx_v_obj;
11435 
11436  /* "View.MemoryView":347
11437  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
11438  * self.obj = obj
11439  * self.flags = flags # <<<<<<<<<<<<<<
11440  * if type(self) is memoryview or obj is not None:
11441  * __Pyx_GetBuffer(obj, &self.view, flags)
11442  */
11443  __pyx_v_self->flags = __pyx_v_flags;
11444 
11445  /* "View.MemoryView":348
11446  * self.obj = obj
11447  * self.flags = flags
11448  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
11449  * __Pyx_GetBuffer(obj, &self.view, flags)
11450  * if <PyObject *> self.view.obj == NULL:
11451  */
11452  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
11453  __pyx_t_3 = (__pyx_t_2 != 0);
11454  if (!__pyx_t_3) {
11455  } else {
11456  __pyx_t_1 = __pyx_t_3;
11457  goto __pyx_L4_bool_binop_done;
11458  }
11459  __pyx_t_3 = (__pyx_v_obj != Py_None);
11460  __pyx_t_2 = (__pyx_t_3 != 0);
11461  __pyx_t_1 = __pyx_t_2;
11462  __pyx_L4_bool_binop_done:;
11463  if (__pyx_t_1) {
11464 
11465  /* "View.MemoryView":349
11466  * self.flags = flags
11467  * if type(self) is memoryview or obj is not None:
11468  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
11469  * if <PyObject *> self.view.obj == NULL:
11470  * (<__pyx_buffer *> &self.view).obj = Py_None
11471  */
11472  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 349, __pyx_L1_error)
11473 
11474  /* "View.MemoryView":350
11475  * if type(self) is memoryview or obj is not None:
11476  * __Pyx_GetBuffer(obj, &self.view, flags)
11477  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
11478  * (<__pyx_buffer *> &self.view).obj = Py_None
11479  * Py_INCREF(Py_None)
11480  */
11481  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
11482  if (__pyx_t_1) {
11483 
11484  /* "View.MemoryView":351
11485  * __Pyx_GetBuffer(obj, &self.view, flags)
11486  * if <PyObject *> self.view.obj == NULL:
11487  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
11488  * Py_INCREF(Py_None)
11489  *
11490  */
11491  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
11492 
11493  /* "View.MemoryView":352
11494  * if <PyObject *> self.view.obj == NULL:
11495  * (<__pyx_buffer *> &self.view).obj = Py_None
11496  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
11497  *
11498  * global __pyx_memoryview_thread_locks_used
11499  */
11500  Py_INCREF(Py_None);
11501 
11502  /* "View.MemoryView":350
11503  * if type(self) is memoryview or obj is not None:
11504  * __Pyx_GetBuffer(obj, &self.view, flags)
11505  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
11506  * (<__pyx_buffer *> &self.view).obj = Py_None
11507  * Py_INCREF(Py_None)
11508  */
11509  }
11510 
11511  /* "View.MemoryView":348
11512  * self.obj = obj
11513  * self.flags = flags
11514  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
11515  * __Pyx_GetBuffer(obj, &self.view, flags)
11516  * if <PyObject *> self.view.obj == NULL:
11517  */
11518  }
11519 
11520  /* "View.MemoryView":355
11521  *
11522  * global __pyx_memoryview_thread_locks_used
11523  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
11524  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11525  * __pyx_memoryview_thread_locks_used += 1
11526  */
11527  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
11528  if (__pyx_t_1) {
11529 
11530  /* "View.MemoryView":356
11531  * global __pyx_memoryview_thread_locks_used
11532  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
11533  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
11534  * __pyx_memoryview_thread_locks_used += 1
11535  * if self.lock is NULL:
11536  */
11537  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11538 
11539  /* "View.MemoryView":357
11540  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
11541  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11542  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
11543  * if self.lock is NULL:
11544  * self.lock = PyThread_allocate_lock()
11545  */
11546  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
11547 
11548  /* "View.MemoryView":355
11549  *
11550  * global __pyx_memoryview_thread_locks_used
11551  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
11552  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11553  * __pyx_memoryview_thread_locks_used += 1
11554  */
11555  }
11556 
11557  /* "View.MemoryView":358
11558  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11559  * __pyx_memoryview_thread_locks_used += 1
11560  * if self.lock is NULL: # <<<<<<<<<<<<<<
11561  * self.lock = PyThread_allocate_lock()
11562  * if self.lock is NULL:
11563  */
11564  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11565  if (__pyx_t_1) {
11566 
11567  /* "View.MemoryView":359
11568  * __pyx_memoryview_thread_locks_used += 1
11569  * if self.lock is NULL:
11570  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
11571  * if self.lock is NULL:
11572  * raise MemoryError
11573  */
11574  __pyx_v_self->lock = PyThread_allocate_lock();
11575 
11576  /* "View.MemoryView":360
11577  * if self.lock is NULL:
11578  * self.lock = PyThread_allocate_lock()
11579  * if self.lock is NULL: # <<<<<<<<<<<<<<
11580  * raise MemoryError
11581  *
11582  */
11583  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11584  if (unlikely(__pyx_t_1)) {
11585 
11586  /* "View.MemoryView":361
11587  * self.lock = PyThread_allocate_lock()
11588  * if self.lock is NULL:
11589  * raise MemoryError # <<<<<<<<<<<<<<
11590  *
11591  * if flags & PyBUF_FORMAT:
11592  */
11593  PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error)
11594 
11595  /* "View.MemoryView":360
11596  * if self.lock is NULL:
11597  * self.lock = PyThread_allocate_lock()
11598  * if self.lock is NULL: # <<<<<<<<<<<<<<
11599  * raise MemoryError
11600  *
11601  */
11602  }
11603 
11604  /* "View.MemoryView":358
11605  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11606  * __pyx_memoryview_thread_locks_used += 1
11607  * if self.lock is NULL: # <<<<<<<<<<<<<<
11608  * self.lock = PyThread_allocate_lock()
11609  * if self.lock is NULL:
11610  */
11611  }
11612 
11613  /* "View.MemoryView":363
11614  * raise MemoryError
11615  *
11616  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11617  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11618  * else:
11619  */
11620  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11621  if (__pyx_t_1) {
11622 
11623  /* "View.MemoryView":364
11624  *
11625  * if flags & PyBUF_FORMAT:
11626  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
11627  * else:
11628  * self.dtype_is_object = dtype_is_object
11629  */
11630  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
11631  if (__pyx_t_2) {
11632  } else {
11633  __pyx_t_1 = __pyx_t_2;
11634  goto __pyx_L11_bool_binop_done;
11635  }
11636  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
11637  __pyx_t_1 = __pyx_t_2;
11638  __pyx_L11_bool_binop_done:;
11639  __pyx_v_self->dtype_is_object = __pyx_t_1;
11640 
11641  /* "View.MemoryView":363
11642  * raise MemoryError
11643  *
11644  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11645  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11646  * else:
11647  */
11648  goto __pyx_L10;
11649  }
11650 
11651  /* "View.MemoryView":366
11652  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11653  * else:
11654  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
11655  *
11656  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11657  */
11658  /*else*/ {
11659  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11660  }
11661  __pyx_L10:;
11662 
11663  /* "View.MemoryView":368
11664  * self.dtype_is_object = dtype_is_object
11665  *
11666  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
11667  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11668  * self.typeinfo = NULL
11669  */
11670  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
11671 
11672  /* "View.MemoryView":370
11673  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11674  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11675  * self.typeinfo = NULL # <<<<<<<<<<<<<<
11676  *
11677  * def __dealloc__(memoryview self):
11678  */
11679  __pyx_v_self->typeinfo = NULL;
11680 
11681  /* "View.MemoryView":345
11682  * cdef __Pyx_TypeInfo *typeinfo
11683  *
11684  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11685  * self.obj = obj
11686  * self.flags = flags
11687  */
11688 
11689  /* function exit code */
11690  __pyx_r = 0;
11691  goto __pyx_L0;
11692  __pyx_L1_error:;
11693  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11694  __pyx_r = -1;
11695  __pyx_L0:;
11696  __Pyx_RefNannyFinishContext();
11697  return __pyx_r;
11698 }
11699 
11700 /* "View.MemoryView":372
11701  * self.typeinfo = NULL
11702  *
11703  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11704  * if self.obj is not None:
11705  * __Pyx_ReleaseBuffer(&self.view)
11706  */
11707 
11708 /* Python wrapper */
11709 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
11710 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11711  __Pyx_RefNannyDeclarations
11712  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
11713  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11714 
11715  /* function exit code */
11716  __Pyx_RefNannyFinishContext();
11717 }
11718 
11719 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
11720  int __pyx_v_i;
11721  __Pyx_RefNannyDeclarations
11722  int __pyx_t_1;
11723  int __pyx_t_2;
11724  int __pyx_t_3;
11725  int __pyx_t_4;
11726  int __pyx_t_5;
11727  PyThread_type_lock __pyx_t_6;
11728  PyThread_type_lock __pyx_t_7;
11729  __Pyx_RefNannySetupContext("__dealloc__", 0);
11730 
11731  /* "View.MemoryView":373
11732  *
11733  * def __dealloc__(memoryview self):
11734  * if self.obj is not None: # <<<<<<<<<<<<<<
11735  * __Pyx_ReleaseBuffer(&self.view)
11736  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11737  */
11738  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11739  __pyx_t_2 = (__pyx_t_1 != 0);
11740  if (__pyx_t_2) {
11741 
11742  /* "View.MemoryView":374
11743  * def __dealloc__(memoryview self):
11744  * if self.obj is not None:
11745  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
11746  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11747  *
11748  */
11749  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11750 
11751  /* "View.MemoryView":373
11752  *
11753  * def __dealloc__(memoryview self):
11754  * if self.obj is not None: # <<<<<<<<<<<<<<
11755  * __Pyx_ReleaseBuffer(&self.view)
11756  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11757  */
11758  goto __pyx_L3;
11759  }
11760 
11761  /* "View.MemoryView":375
11762  * if self.obj is not None:
11763  * __Pyx_ReleaseBuffer(&self.view)
11764  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11765  *
11766  * (<__pyx_buffer *> &self.view).obj = NULL
11767  */
11768  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
11769  if (__pyx_t_2) {
11770 
11771  /* "View.MemoryView":377
11772  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11773  *
11774  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
11775  * Py_DECREF(Py_None)
11776  *
11777  */
11778  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
11779 
11780  /* "View.MemoryView":378
11781  *
11782  * (<__pyx_buffer *> &self.view).obj = NULL
11783  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
11784  *
11785  * cdef int i
11786  */
11787  Py_DECREF(Py_None);
11788 
11789  /* "View.MemoryView":375
11790  * if self.obj is not None:
11791  * __Pyx_ReleaseBuffer(&self.view)
11792  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11793  *
11794  * (<__pyx_buffer *> &self.view).obj = NULL
11795  */
11796  }
11797  __pyx_L3:;
11798 
11799  /* "View.MemoryView":382
11800  * cdef int i
11801  * global __pyx_memoryview_thread_locks_used
11802  * if self.lock != NULL: # <<<<<<<<<<<<<<
11803  * for i in range(__pyx_memoryview_thread_locks_used):
11804  * if __pyx_memoryview_thread_locks[i] is self.lock:
11805  */
11806  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11807  if (__pyx_t_2) {
11808 
11809  /* "View.MemoryView":383
11810  * global __pyx_memoryview_thread_locks_used
11811  * if self.lock != NULL:
11812  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
11813  * if __pyx_memoryview_thread_locks[i] is self.lock:
11814  * __pyx_memoryview_thread_locks_used -= 1
11815  */
11816  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11817  __pyx_t_4 = __pyx_t_3;
11818  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11819  __pyx_v_i = __pyx_t_5;
11820 
11821  /* "View.MemoryView":384
11822  * if self.lock != NULL:
11823  * for i in range(__pyx_memoryview_thread_locks_used):
11824  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11825  * __pyx_memoryview_thread_locks_used -= 1
11826  * if i != __pyx_memoryview_thread_locks_used:
11827  */
11828  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11829  if (__pyx_t_2) {
11830 
11831  /* "View.MemoryView":385
11832  * for i in range(__pyx_memoryview_thread_locks_used):
11833  * if __pyx_memoryview_thread_locks[i] is self.lock:
11834  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
11835  * if i != __pyx_memoryview_thread_locks_used:
11836  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11837  */
11838  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11839 
11840  /* "View.MemoryView":386
11841  * if __pyx_memoryview_thread_locks[i] is self.lock:
11842  * __pyx_memoryview_thread_locks_used -= 1
11843  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11844  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11845  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11846  */
11847  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11848  if (__pyx_t_2) {
11849 
11850  /* "View.MemoryView":388
11851  * if i != __pyx_memoryview_thread_locks_used:
11852  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11853  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
11854  * break
11855  * else:
11856  */
11857  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11858  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11859 
11860  /* "View.MemoryView":387
11861  * __pyx_memoryview_thread_locks_used -= 1
11862  * if i != __pyx_memoryview_thread_locks_used:
11863  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
11864  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11865  * break
11866  */
11867  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11868  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11869 
11870  /* "View.MemoryView":386
11871  * if __pyx_memoryview_thread_locks[i] is self.lock:
11872  * __pyx_memoryview_thread_locks_used -= 1
11873  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11874  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11875  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11876  */
11877  }
11878 
11879  /* "View.MemoryView":389
11880  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11881  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11882  * break # <<<<<<<<<<<<<<
11883  * else:
11884  * PyThread_free_lock(self.lock)
11885  */
11886  goto __pyx_L6_break;
11887 
11888  /* "View.MemoryView":384
11889  * if self.lock != NULL:
11890  * for i in range(__pyx_memoryview_thread_locks_used):
11891  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11892  * __pyx_memoryview_thread_locks_used -= 1
11893  * if i != __pyx_memoryview_thread_locks_used:
11894  */
11895  }
11896  }
11897  /*else*/ {
11898 
11899  /* "View.MemoryView":391
11900  * break
11901  * else:
11902  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
11903  *
11904  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11905  */
11906  PyThread_free_lock(__pyx_v_self->lock);
11907  }
11908  __pyx_L6_break:;
11909 
11910  /* "View.MemoryView":382
11911  * cdef int i
11912  * global __pyx_memoryview_thread_locks_used
11913  * if self.lock != NULL: # <<<<<<<<<<<<<<
11914  * for i in range(__pyx_memoryview_thread_locks_used):
11915  * if __pyx_memoryview_thread_locks[i] is self.lock:
11916  */
11917  }
11918 
11919  /* "View.MemoryView":372
11920  * self.typeinfo = NULL
11921  *
11922  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11923  * if self.obj is not None:
11924  * __Pyx_ReleaseBuffer(&self.view)
11925  */
11926 
11927  /* function exit code */
11928  __Pyx_RefNannyFinishContext();
11929 }
11930 
11931 /* "View.MemoryView":393
11932  * PyThread_free_lock(self.lock)
11933  *
11934  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11935  * cdef Py_ssize_t dim
11936  * cdef char *itemp = <char *> self.view.buf
11937  */
11938 
11939 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11940  Py_ssize_t __pyx_v_dim;
11941  char *__pyx_v_itemp;
11942  PyObject *__pyx_v_idx = NULL;
11943  char *__pyx_r;
11944  __Pyx_RefNannyDeclarations
11945  Py_ssize_t __pyx_t_1;
11946  PyObject *__pyx_t_2 = NULL;
11947  Py_ssize_t __pyx_t_3;
11948  PyObject *(*__pyx_t_4)(PyObject *);
11949  PyObject *__pyx_t_5 = NULL;
11950  Py_ssize_t __pyx_t_6;
11951  char *__pyx_t_7;
11952  __Pyx_RefNannySetupContext("get_item_pointer", 0);
11953 
11954  /* "View.MemoryView":395
11955  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11956  * cdef Py_ssize_t dim
11957  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
11958  *
11959  * for dim, idx in enumerate(index):
11960  */
11961  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
11962 
11963  /* "View.MemoryView":397
11964  * cdef char *itemp = <char *> self.view.buf
11965  *
11966  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11967  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11968  *
11969  */
11970  __pyx_t_1 = 0;
11971  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11972  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11973  __pyx_t_4 = NULL;
11974  } else {
11975  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 397, __pyx_L1_error)
11976  __Pyx_GOTREF(__pyx_t_2);
11977  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 397, __pyx_L1_error)
11978  }
11979  for (;;) {
11980  if (likely(!__pyx_t_4)) {
11981  if (likely(PyList_CheckExact(__pyx_t_2))) {
11982  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
11983  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11984  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
11985  #else
11986  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
11987  __Pyx_GOTREF(__pyx_t_5);
11988  #endif
11989  } else {
11990  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11991  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11992  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
11993  #else
11994  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
11995  __Pyx_GOTREF(__pyx_t_5);
11996  #endif
11997  }
11998  } else {
11999  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
12000  if (unlikely(!__pyx_t_5)) {
12001  PyObject* exc_type = PyErr_Occurred();
12002  if (exc_type) {
12003  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12004  else __PYX_ERR(2, 397, __pyx_L1_error)
12005  }
12006  break;
12007  }
12008  __Pyx_GOTREF(__pyx_t_5);
12009  }
12010  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
12011  __pyx_t_5 = 0;
12012  __pyx_v_dim = __pyx_t_1;
12013  __pyx_t_1 = (__pyx_t_1 + 1);
12014 
12015  /* "View.MemoryView":398
12016  *
12017  * for dim, idx in enumerate(index):
12018  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
12019  *
12020  * return itemp
12021  */
12022  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 398, __pyx_L1_error)
12023  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 398, __pyx_L1_error)
12024  __pyx_v_itemp = __pyx_t_7;
12025 
12026  /* "View.MemoryView":397
12027  * cdef char *itemp = <char *> self.view.buf
12028  *
12029  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
12030  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
12031  *
12032  */
12033  }
12034  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12035 
12036  /* "View.MemoryView":400
12037  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
12038  *
12039  * return itemp # <<<<<<<<<<<<<<
12040  *
12041  *
12042  */
12043  __pyx_r = __pyx_v_itemp;
12044  goto __pyx_L0;
12045 
12046  /* "View.MemoryView":393
12047  * PyThread_free_lock(self.lock)
12048  *
12049  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
12050  * cdef Py_ssize_t dim
12051  * cdef char *itemp = <char *> self.view.buf
12052  */
12053 
12054  /* function exit code */
12055  __pyx_L1_error:;
12056  __Pyx_XDECREF(__pyx_t_2);
12057  __Pyx_XDECREF(__pyx_t_5);
12058  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
12059  __pyx_r = NULL;
12060  __pyx_L0:;
12061  __Pyx_XDECREF(__pyx_v_idx);
12062  __Pyx_RefNannyFinishContext();
12063  return __pyx_r;
12064 }
12065 
12066 /* "View.MemoryView":403
12067  *
12068  *
12069  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
12070  * if index is Ellipsis:
12071  * return self
12072  */
12073 
12074 /* Python wrapper */
12075 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
12076 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
12077  PyObject *__pyx_r = 0;
12078  __Pyx_RefNannyDeclarations
12079  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
12080  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
12081 
12082  /* function exit code */
12083  __Pyx_RefNannyFinishContext();
12084  return __pyx_r;
12085 }
12086 
12087 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
12088  PyObject *__pyx_v_have_slices = NULL;
12089  PyObject *__pyx_v_indices = NULL;
12090  char *__pyx_v_itemp;
12091  PyObject *__pyx_r = NULL;
12092  __Pyx_RefNannyDeclarations
12093  int __pyx_t_1;
12094  int __pyx_t_2;
12095  PyObject *__pyx_t_3 = NULL;
12096  PyObject *__pyx_t_4 = NULL;
12097  PyObject *__pyx_t_5 = NULL;
12098  char *__pyx_t_6;
12099  __Pyx_RefNannySetupContext("__getitem__", 0);
12100 
12101  /* "View.MemoryView":404
12102  *
12103  * def __getitem__(memoryview self, object index):
12104  * if index is Ellipsis: # <<<<<<<<<<<<<<
12105  * return self
12106  *
12107  */
12108  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
12109  __pyx_t_2 = (__pyx_t_1 != 0);
12110  if (__pyx_t_2) {
12111 
12112  /* "View.MemoryView":405
12113  * def __getitem__(memoryview self, object index):
12114  * if index is Ellipsis:
12115  * return self # <<<<<<<<<<<<<<
12116  *
12117  * have_slices, indices = _unellipsify(index, self.view.ndim)
12118  */
12119  __Pyx_XDECREF(__pyx_r);
12120  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12121  __pyx_r = ((PyObject *)__pyx_v_self);
12122  goto __pyx_L0;
12123 
12124  /* "View.MemoryView":404
12125  *
12126  * def __getitem__(memoryview self, object index):
12127  * if index is Ellipsis: # <<<<<<<<<<<<<<
12128  * return self
12129  *
12130  */
12131  }
12132 
12133  /* "View.MemoryView":407
12134  * return self
12135  *
12136  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
12137  *
12138  * cdef char *itemp
12139  */
12140  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error)
12141  __Pyx_GOTREF(__pyx_t_3);
12142  if (likely(__pyx_t_3 != Py_None)) {
12143  PyObject* sequence = __pyx_t_3;
12144  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12145  if (unlikely(size != 2)) {
12146  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12147  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12148  __PYX_ERR(2, 407, __pyx_L1_error)
12149  }
12150  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12151  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
12152  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
12153  __Pyx_INCREF(__pyx_t_4);
12154  __Pyx_INCREF(__pyx_t_5);
12155  #else
12156  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 407, __pyx_L1_error)
12157  __Pyx_GOTREF(__pyx_t_4);
12158  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 407, __pyx_L1_error)
12159  __Pyx_GOTREF(__pyx_t_5);
12160  #endif
12161  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12162  } else {
12163  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 407, __pyx_L1_error)
12164  }
12165  __pyx_v_have_slices = __pyx_t_4;
12166  __pyx_t_4 = 0;
12167  __pyx_v_indices = __pyx_t_5;
12168  __pyx_t_5 = 0;
12169 
12170  /* "View.MemoryView":410
12171  *
12172  * cdef char *itemp
12173  * if have_slices: # <<<<<<<<<<<<<<
12174  * return memview_slice(self, indices)
12175  * else:
12176  */
12177  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 410, __pyx_L1_error)
12178  if (__pyx_t_2) {
12179 
12180  /* "View.MemoryView":411
12181  * cdef char *itemp
12182  * if have_slices:
12183  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
12184  * else:
12185  * itemp = self.get_item_pointer(indices)
12186  */
12187  __Pyx_XDECREF(__pyx_r);
12188  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error)
12189  __Pyx_GOTREF(__pyx_t_3);
12190  __pyx_r = __pyx_t_3;
12191  __pyx_t_3 = 0;
12192  goto __pyx_L0;
12193 
12194  /* "View.MemoryView":410
12195  *
12196  * cdef char *itemp
12197  * if have_slices: # <<<<<<<<<<<<<<
12198  * return memview_slice(self, indices)
12199  * else:
12200  */
12201  }
12202 
12203  /* "View.MemoryView":413
12204  * return memview_slice(self, indices)
12205  * else:
12206  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
12207  * return self.convert_item_to_object(itemp)
12208  *
12209  */
12210  /*else*/ {
12211  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error)
12212  __pyx_v_itemp = __pyx_t_6;
12213 
12214  /* "View.MemoryView":414
12215  * else:
12216  * itemp = self.get_item_pointer(indices)
12217  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
12218  *
12219  * def __setitem__(memoryview self, object index, object value):
12220  */
12221  __Pyx_XDECREF(__pyx_r);
12222  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error)
12223  __Pyx_GOTREF(__pyx_t_3);
12224  __pyx_r = __pyx_t_3;
12225  __pyx_t_3 = 0;
12226  goto __pyx_L0;
12227  }
12228 
12229  /* "View.MemoryView":403
12230  *
12231  *
12232  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
12233  * if index is Ellipsis:
12234  * return self
12235  */
12236 
12237  /* function exit code */
12238  __pyx_L1_error:;
12239  __Pyx_XDECREF(__pyx_t_3);
12240  __Pyx_XDECREF(__pyx_t_4);
12241  __Pyx_XDECREF(__pyx_t_5);
12242  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12243  __pyx_r = NULL;
12244  __pyx_L0:;
12245  __Pyx_XDECREF(__pyx_v_have_slices);
12246  __Pyx_XDECREF(__pyx_v_indices);
12247  __Pyx_XGIVEREF(__pyx_r);
12248  __Pyx_RefNannyFinishContext();
12249  return __pyx_r;
12250 }
12251 
12252 /* "View.MemoryView":416
12253  * return self.convert_item_to_object(itemp)
12254  *
12255  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
12256  * if self.view.readonly:
12257  * raise TypeError("Cannot assign to read-only memoryview")
12258  */
12259 
12260 /* Python wrapper */
12261 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
12262 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12263  int __pyx_r;
12264  __Pyx_RefNannyDeclarations
12265  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
12266  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
12267 
12268  /* function exit code */
12269  __Pyx_RefNannyFinishContext();
12270  return __pyx_r;
12271 }
12272 
12273 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12274  PyObject *__pyx_v_have_slices = NULL;
12275  PyObject *__pyx_v_obj = NULL;
12276  int __pyx_r;
12277  __Pyx_RefNannyDeclarations
12278  int __pyx_t_1;
12279  PyObject *__pyx_t_2 = NULL;
12280  PyObject *__pyx_t_3 = NULL;
12281  PyObject *__pyx_t_4 = NULL;
12282  __Pyx_RefNannySetupContext("__setitem__", 0);
12283  __Pyx_INCREF(__pyx_v_index);
12284 
12285  /* "View.MemoryView":417
12286  *
12287  * def __setitem__(memoryview self, object index, object value):
12288  * if self.view.readonly: # <<<<<<<<<<<<<<
12289  * raise TypeError("Cannot assign to read-only memoryview")
12290  *
12291  */
12292  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
12293  if (unlikely(__pyx_t_1)) {
12294 
12295  /* "View.MemoryView":418
12296  * def __setitem__(memoryview self, object index, object value):
12297  * if self.view.readonly:
12298  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
12299  *
12300  * have_slices, index = _unellipsify(index, self.view.ndim)
12301  */
12302  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error)
12303  __Pyx_GOTREF(__pyx_t_2);
12304  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12305  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12306  __PYX_ERR(2, 418, __pyx_L1_error)
12307 
12308  /* "View.MemoryView":417
12309  *
12310  * def __setitem__(memoryview self, object index, object value):
12311  * if self.view.readonly: # <<<<<<<<<<<<<<
12312  * raise TypeError("Cannot assign to read-only memoryview")
12313  *
12314  */
12315  }
12316 
12317  /* "View.MemoryView":420
12318  * raise TypeError("Cannot assign to read-only memoryview")
12319  *
12320  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
12321  *
12322  * if have_slices:
12323  */
12324  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error)
12325  __Pyx_GOTREF(__pyx_t_2);
12326  if (likely(__pyx_t_2 != Py_None)) {
12327  PyObject* sequence = __pyx_t_2;
12328  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12329  if (unlikely(size != 2)) {
12330  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12331  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12332  __PYX_ERR(2, 420, __pyx_L1_error)
12333  }
12334  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12335  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
12336  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
12337  __Pyx_INCREF(__pyx_t_3);
12338  __Pyx_INCREF(__pyx_t_4);
12339  #else
12340  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 420, __pyx_L1_error)
12341  __Pyx_GOTREF(__pyx_t_3);
12342  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error)
12343  __Pyx_GOTREF(__pyx_t_4);
12344  #endif
12345  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12346  } else {
12347  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 420, __pyx_L1_error)
12348  }
12349  __pyx_v_have_slices = __pyx_t_3;
12350  __pyx_t_3 = 0;
12351  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
12352  __pyx_t_4 = 0;
12353 
12354  /* "View.MemoryView":422
12355  * have_slices, index = _unellipsify(index, self.view.ndim)
12356  *
12357  * if have_slices: # <<<<<<<<<<<<<<
12358  * obj = self.is_slice(value)
12359  * if obj:
12360  */
12361  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 422, __pyx_L1_error)
12362  if (__pyx_t_1) {
12363 
12364  /* "View.MemoryView":423
12365  *
12366  * if have_slices:
12367  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
12368  * if obj:
12369  * self.setitem_slice_assignment(self[index], obj)
12370  */
12371  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 423, __pyx_L1_error)
12372  __Pyx_GOTREF(__pyx_t_2);
12373  __pyx_v_obj = __pyx_t_2;
12374  __pyx_t_2 = 0;
12375 
12376  /* "View.MemoryView":424
12377  * if have_slices:
12378  * obj = self.is_slice(value)
12379  * if obj: # <<<<<<<<<<<<<<
12380  * self.setitem_slice_assignment(self[index], obj)
12381  * else:
12382  */
12383  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error)
12384  if (__pyx_t_1) {
12385 
12386  /* "View.MemoryView":425
12387  * obj = self.is_slice(value)
12388  * if obj:
12389  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
12390  * else:
12391  * self.setitem_slice_assign_scalar(self[index], value)
12392  */
12393  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error)
12394  __Pyx_GOTREF(__pyx_t_2);
12395  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 425, __pyx_L1_error)
12396  __Pyx_GOTREF(__pyx_t_4);
12397  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12398  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12399 
12400  /* "View.MemoryView":424
12401  * if have_slices:
12402  * obj = self.is_slice(value)
12403  * if obj: # <<<<<<<<<<<<<<
12404  * self.setitem_slice_assignment(self[index], obj)
12405  * else:
12406  */
12407  goto __pyx_L5;
12408  }
12409 
12410  /* "View.MemoryView":427
12411  * self.setitem_slice_assignment(self[index], obj)
12412  * else:
12413  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
12414  * else:
12415  * self.setitem_indexed(index, value)
12416  */
12417  /*else*/ {
12418  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error)
12419  __Pyx_GOTREF(__pyx_t_4);
12420  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 427, __pyx_L1_error)
12421  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error)
12422  __Pyx_GOTREF(__pyx_t_2);
12423  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12424  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12425  }
12426  __pyx_L5:;
12427 
12428  /* "View.MemoryView":422
12429  * have_slices, index = _unellipsify(index, self.view.ndim)
12430  *
12431  * if have_slices: # <<<<<<<<<<<<<<
12432  * obj = self.is_slice(value)
12433  * if obj:
12434  */
12435  goto __pyx_L4;
12436  }
12437 
12438  /* "View.MemoryView":429
12439  * self.setitem_slice_assign_scalar(self[index], value)
12440  * else:
12441  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
12442  *
12443  * cdef is_slice(self, obj):
12444  */
12445  /*else*/ {
12446  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error)
12447  __Pyx_GOTREF(__pyx_t_2);
12448  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12449  }
12450  __pyx_L4:;
12451 
12452  /* "View.MemoryView":416
12453  * return self.convert_item_to_object(itemp)
12454  *
12455  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
12456  * if self.view.readonly:
12457  * raise TypeError("Cannot assign to read-only memoryview")
12458  */
12459 
12460  /* function exit code */
12461  __pyx_r = 0;
12462  goto __pyx_L0;
12463  __pyx_L1_error:;
12464  __Pyx_XDECREF(__pyx_t_2);
12465  __Pyx_XDECREF(__pyx_t_3);
12466  __Pyx_XDECREF(__pyx_t_4);
12467  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12468  __pyx_r = -1;
12469  __pyx_L0:;
12470  __Pyx_XDECREF(__pyx_v_have_slices);
12471  __Pyx_XDECREF(__pyx_v_obj);
12472  __Pyx_XDECREF(__pyx_v_index);
12473  __Pyx_RefNannyFinishContext();
12474  return __pyx_r;
12475 }
12476 
12477 /* "View.MemoryView":431
12478  * self.setitem_indexed(index, value)
12479  *
12480  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12481  * if not isinstance(obj, memoryview):
12482  * try:
12483  */
12484 
12485 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
12486  PyObject *__pyx_r = NULL;
12487  __Pyx_RefNannyDeclarations
12488  int __pyx_t_1;
12489  int __pyx_t_2;
12490  PyObject *__pyx_t_3 = NULL;
12491  PyObject *__pyx_t_4 = NULL;
12492  PyObject *__pyx_t_5 = NULL;
12493  PyObject *__pyx_t_6 = NULL;
12494  PyObject *__pyx_t_7 = NULL;
12495  PyObject *__pyx_t_8 = NULL;
12496  int __pyx_t_9;
12497  __Pyx_RefNannySetupContext("is_slice", 0);
12498  __Pyx_INCREF(__pyx_v_obj);
12499 
12500  /* "View.MemoryView":432
12501  *
12502  * cdef is_slice(self, obj):
12503  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12504  * try:
12505  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12506  */
12507  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
12508  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12509  if (__pyx_t_2) {
12510 
12511  /* "View.MemoryView":433
12512  * cdef is_slice(self, obj):
12513  * if not isinstance(obj, memoryview):
12514  * try: # <<<<<<<<<<<<<<
12515  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12516  * self.dtype_is_object)
12517  */
12518  {
12519  __Pyx_PyThreadState_declare
12520  __Pyx_PyThreadState_assign
12521  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
12522  __Pyx_XGOTREF(__pyx_t_3);
12523  __Pyx_XGOTREF(__pyx_t_4);
12524  __Pyx_XGOTREF(__pyx_t_5);
12525  /*try:*/ {
12526 
12527  /* "View.MemoryView":434
12528  * if not isinstance(obj, memoryview):
12529  * try:
12530  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
12531  * self.dtype_is_object)
12532  * except TypeError:
12533  */
12534  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L4_error)
12535  __Pyx_GOTREF(__pyx_t_6);
12536 
12537  /* "View.MemoryView":435
12538  * try:
12539  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12540  * self.dtype_is_object) # <<<<<<<<<<<<<<
12541  * except TypeError:
12542  * return None
12543  */
12544  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 435, __pyx_L4_error)
12545  __Pyx_GOTREF(__pyx_t_7);
12546 
12547  /* "View.MemoryView":434
12548  * if not isinstance(obj, memoryview):
12549  * try:
12550  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
12551  * self.dtype_is_object)
12552  * except TypeError:
12553  */
12554  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 434, __pyx_L4_error)
12555  __Pyx_GOTREF(__pyx_t_8);
12556  __Pyx_INCREF(__pyx_v_obj);
12557  __Pyx_GIVEREF(__pyx_v_obj);
12558  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
12559  __Pyx_GIVEREF(__pyx_t_6);
12560  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
12561  __Pyx_GIVEREF(__pyx_t_7);
12562  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
12563  __pyx_t_6 = 0;
12564  __pyx_t_7 = 0;
12565  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 434, __pyx_L4_error)
12566  __Pyx_GOTREF(__pyx_t_7);
12567  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12568  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
12569  __pyx_t_7 = 0;
12570 
12571  /* "View.MemoryView":433
12572  * cdef is_slice(self, obj):
12573  * if not isinstance(obj, memoryview):
12574  * try: # <<<<<<<<<<<<<<
12575  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12576  * self.dtype_is_object)
12577  */
12578  }
12579  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12580  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12581  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12582  goto __pyx_L9_try_end;
12583  __pyx_L4_error:;
12584  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12585  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12586  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12587 
12588  /* "View.MemoryView":436
12589  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12590  * self.dtype_is_object)
12591  * except TypeError: # <<<<<<<<<<<<<<
12592  * return None
12593  *
12594  */
12595  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12596  if (__pyx_t_9) {
12597  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12598  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 436, __pyx_L6_except_error)
12599  __Pyx_GOTREF(__pyx_t_7);
12600  __Pyx_GOTREF(__pyx_t_8);
12601  __Pyx_GOTREF(__pyx_t_6);
12602 
12603  /* "View.MemoryView":437
12604  * self.dtype_is_object)
12605  * except TypeError:
12606  * return None # <<<<<<<<<<<<<<
12607  *
12608  * return obj
12609  */
12610  __Pyx_XDECREF(__pyx_r);
12611  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12612  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12613  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12614  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12615  goto __pyx_L7_except_return;
12616  }
12617  goto __pyx_L6_except_error;
12618  __pyx_L6_except_error:;
12619 
12620  /* "View.MemoryView":433
12621  * cdef is_slice(self, obj):
12622  * if not isinstance(obj, memoryview):
12623  * try: # <<<<<<<<<<<<<<
12624  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12625  * self.dtype_is_object)
12626  */
12627  __Pyx_XGIVEREF(__pyx_t_3);
12628  __Pyx_XGIVEREF(__pyx_t_4);
12629  __Pyx_XGIVEREF(__pyx_t_5);
12630  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12631  goto __pyx_L1_error;
12632  __pyx_L7_except_return:;
12633  __Pyx_XGIVEREF(__pyx_t_3);
12634  __Pyx_XGIVEREF(__pyx_t_4);
12635  __Pyx_XGIVEREF(__pyx_t_5);
12636  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12637  goto __pyx_L0;
12638  __pyx_L9_try_end:;
12639  }
12640 
12641  /* "View.MemoryView":432
12642  *
12643  * cdef is_slice(self, obj):
12644  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12645  * try:
12646  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12647  */
12648  }
12649 
12650  /* "View.MemoryView":439
12651  * return None
12652  *
12653  * return obj # <<<<<<<<<<<<<<
12654  *
12655  * cdef setitem_slice_assignment(self, dst, src):
12656  */
12657  __Pyx_XDECREF(__pyx_r);
12658  __Pyx_INCREF(__pyx_v_obj);
12659  __pyx_r = __pyx_v_obj;
12660  goto __pyx_L0;
12661 
12662  /* "View.MemoryView":431
12663  * self.setitem_indexed(index, value)
12664  *
12665  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12666  * if not isinstance(obj, memoryview):
12667  * try:
12668  */
12669 
12670  /* function exit code */
12671  __pyx_L1_error:;
12672  __Pyx_XDECREF(__pyx_t_6);
12673  __Pyx_XDECREF(__pyx_t_7);
12674  __Pyx_XDECREF(__pyx_t_8);
12675  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12676  __pyx_r = 0;
12677  __pyx_L0:;
12678  __Pyx_XDECREF(__pyx_v_obj);
12679  __Pyx_XGIVEREF(__pyx_r);
12680  __Pyx_RefNannyFinishContext();
12681  return __pyx_r;
12682 }
12683 
12684 /* "View.MemoryView":441
12685  * return obj
12686  *
12687  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12688  * cdef __Pyx_memviewslice dst_slice
12689  * cdef __Pyx_memviewslice src_slice
12690  */
12691 
12692 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12693  __Pyx_memviewslice __pyx_v_dst_slice;
12694  __Pyx_memviewslice __pyx_v_src_slice;
12695  PyObject *__pyx_r = NULL;
12696  __Pyx_RefNannyDeclarations
12697  __Pyx_memviewslice *__pyx_t_1;
12698  __Pyx_memviewslice *__pyx_t_2;
12699  PyObject *__pyx_t_3 = NULL;
12700  int __pyx_t_4;
12701  int __pyx_t_5;
12702  int __pyx_t_6;
12703  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
12704 
12705  /* "View.MemoryView":445
12706  * cdef __Pyx_memviewslice src_slice
12707  *
12708  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12709  * get_slice_from_memview(dst, &dst_slice)[0],
12710  * src.ndim, dst.ndim, self.dtype_is_object)
12711  */
12712  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 445, __pyx_L1_error)
12713  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 445, __pyx_L1_error)
12714 
12715  /* "View.MemoryView":446
12716  *
12717  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12718  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
12719  * src.ndim, dst.ndim, self.dtype_is_object)
12720  *
12721  */
12722  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 446, __pyx_L1_error)
12723  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 446, __pyx_L1_error)
12724 
12725  /* "View.MemoryView":447
12726  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12727  * get_slice_from_memview(dst, &dst_slice)[0],
12728  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
12729  *
12730  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12731  */
12732  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
12733  __Pyx_GOTREF(__pyx_t_3);
12734  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
12735  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12736  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
12737  __Pyx_GOTREF(__pyx_t_3);
12738  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
12739  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12740 
12741  /* "View.MemoryView":445
12742  * cdef __Pyx_memviewslice src_slice
12743  *
12744  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12745  * get_slice_from_memview(dst, &dst_slice)[0],
12746  * src.ndim, dst.ndim, self.dtype_is_object)
12747  */
12748  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 445, __pyx_L1_error)
12749 
12750  /* "View.MemoryView":441
12751  * return obj
12752  *
12753  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12754  * cdef __Pyx_memviewslice dst_slice
12755  * cdef __Pyx_memviewslice src_slice
12756  */
12757 
12758  /* function exit code */
12759  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12760  goto __pyx_L0;
12761  __pyx_L1_error:;
12762  __Pyx_XDECREF(__pyx_t_3);
12763  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12764  __pyx_r = 0;
12765  __pyx_L0:;
12766  __Pyx_XGIVEREF(__pyx_r);
12767  __Pyx_RefNannyFinishContext();
12768  return __pyx_r;
12769 }
12770 
12771 /* "View.MemoryView":449
12772  * src.ndim, dst.ndim, self.dtype_is_object)
12773  *
12774  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12775  * cdef int array[128]
12776  * cdef void *tmp = NULL
12777  */
12778 
12779 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12780  int __pyx_v_array[0x80];
12781  void *__pyx_v_tmp;
12782  void *__pyx_v_item;
12783  __Pyx_memviewslice *__pyx_v_dst_slice;
12784  __Pyx_memviewslice __pyx_v_tmp_slice;
12785  PyObject *__pyx_r = NULL;
12786  __Pyx_RefNannyDeclarations
12787  __Pyx_memviewslice *__pyx_t_1;
12788  int __pyx_t_2;
12789  PyObject *__pyx_t_3 = NULL;
12790  int __pyx_t_4;
12791  int __pyx_t_5;
12792  char const *__pyx_t_6;
12793  PyObject *__pyx_t_7 = NULL;
12794  PyObject *__pyx_t_8 = NULL;
12795  PyObject *__pyx_t_9 = NULL;
12796  PyObject *__pyx_t_10 = NULL;
12797  PyObject *__pyx_t_11 = NULL;
12798  PyObject *__pyx_t_12 = NULL;
12799  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
12800 
12801  /* "View.MemoryView":451
12802  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12803  * cdef int array[128]
12804  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
12805  * cdef void *item
12806  *
12807  */
12808  __pyx_v_tmp = NULL;
12809 
12810  /* "View.MemoryView":456
12811  * cdef __Pyx_memviewslice *dst_slice
12812  * cdef __Pyx_memviewslice tmp_slice
12813  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
12814  *
12815  * if <size_t>self.view.itemsize > sizeof(array):
12816  */
12817  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 456, __pyx_L1_error)
12818  __pyx_v_dst_slice = __pyx_t_1;
12819 
12820  /* "View.MemoryView":458
12821  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12822  *
12823  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12824  * tmp = PyMem_Malloc(self.view.itemsize)
12825  * if tmp == NULL:
12826  */
12827  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
12828  if (__pyx_t_2) {
12829 
12830  /* "View.MemoryView":459
12831  *
12832  * if <size_t>self.view.itemsize > sizeof(array):
12833  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
12834  * if tmp == NULL:
12835  * raise MemoryError
12836  */
12837  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12838 
12839  /* "View.MemoryView":460
12840  * if <size_t>self.view.itemsize > sizeof(array):
12841  * tmp = PyMem_Malloc(self.view.itemsize)
12842  * if tmp == NULL: # <<<<<<<<<<<<<<
12843  * raise MemoryError
12844  * item = tmp
12845  */
12846  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
12847  if (unlikely(__pyx_t_2)) {
12848 
12849  /* "View.MemoryView":461
12850  * tmp = PyMem_Malloc(self.view.itemsize)
12851  * if tmp == NULL:
12852  * raise MemoryError # <<<<<<<<<<<<<<
12853  * item = tmp
12854  * else:
12855  */
12856  PyErr_NoMemory(); __PYX_ERR(2, 461, __pyx_L1_error)
12857 
12858  /* "View.MemoryView":460
12859  * if <size_t>self.view.itemsize > sizeof(array):
12860  * tmp = PyMem_Malloc(self.view.itemsize)
12861  * if tmp == NULL: # <<<<<<<<<<<<<<
12862  * raise MemoryError
12863  * item = tmp
12864  */
12865  }
12866 
12867  /* "View.MemoryView":462
12868  * if tmp == NULL:
12869  * raise MemoryError
12870  * item = tmp # <<<<<<<<<<<<<<
12871  * else:
12872  * item = <void *> array
12873  */
12874  __pyx_v_item = __pyx_v_tmp;
12875 
12876  /* "View.MemoryView":458
12877  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12878  *
12879  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12880  * tmp = PyMem_Malloc(self.view.itemsize)
12881  * if tmp == NULL:
12882  */
12883  goto __pyx_L3;
12884  }
12885 
12886  /* "View.MemoryView":464
12887  * item = tmp
12888  * else:
12889  * item = <void *> array # <<<<<<<<<<<<<<
12890  *
12891  * try:
12892  */
12893  /*else*/ {
12894  __pyx_v_item = ((void *)__pyx_v_array);
12895  }
12896  __pyx_L3:;
12897 
12898  /* "View.MemoryView":466
12899  * item = <void *> array
12900  *
12901  * try: # <<<<<<<<<<<<<<
12902  * if self.dtype_is_object:
12903  * (<PyObject **> item)[0] = <PyObject *> value
12904  */
12905  /*try:*/ {
12906 
12907  /* "View.MemoryView":467
12908  *
12909  * try:
12910  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12911  * (<PyObject **> item)[0] = <PyObject *> value
12912  * else:
12913  */
12914  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
12915  if (__pyx_t_2) {
12916 
12917  /* "View.MemoryView":468
12918  * try:
12919  * if self.dtype_is_object:
12920  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
12921  * else:
12922  * self.assign_item_from_object(<char *> item, value)
12923  */
12924  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12925 
12926  /* "View.MemoryView":467
12927  *
12928  * try:
12929  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12930  * (<PyObject **> item)[0] = <PyObject *> value
12931  * else:
12932  */
12933  goto __pyx_L8;
12934  }
12935 
12936  /* "View.MemoryView":470
12937  * (<PyObject **> item)[0] = <PyObject *> value
12938  * else:
12939  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
12940  *
12941  *
12942  */
12943  /*else*/ {
12944  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 470, __pyx_L6_error)
12945  __Pyx_GOTREF(__pyx_t_3);
12946  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12947  }
12948  __pyx_L8:;
12949 
12950  /* "View.MemoryView":474
12951  *
12952  *
12953  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12954  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12955  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12956  */
12957  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12958  if (__pyx_t_2) {
12959 
12960  /* "View.MemoryView":475
12961  *
12962  * if self.view.suboffsets != NULL:
12963  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
12964  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12965  * item, self.dtype_is_object)
12966  */
12967  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 475, __pyx_L6_error)
12968  __Pyx_GOTREF(__pyx_t_3);
12969  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12970 
12971  /* "View.MemoryView":474
12972  *
12973  *
12974  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12975  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12976  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12977  */
12978  }
12979 
12980  /* "View.MemoryView":476
12981  * if self.view.suboffsets != NULL:
12982  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12983  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
12984  * item, self.dtype_is_object)
12985  * finally:
12986  */
12987  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12988  }
12989 
12990  /* "View.MemoryView":479
12991  * item, self.dtype_is_object)
12992  * finally:
12993  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
12994  *
12995  * cdef setitem_indexed(self, index, value):
12996  */
12997  /*finally:*/ {
12998  /*normal exit:*/{
12999  PyMem_Free(__pyx_v_tmp);
13000  goto __pyx_L7;
13001  }
13002  __pyx_L6_error:;
13003  /*exception exit:*/{
13004  __Pyx_PyThreadState_declare
13005  __Pyx_PyThreadState_assign
13006  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
13007  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13008  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
13009  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
13010  __Pyx_XGOTREF(__pyx_t_7);
13011  __Pyx_XGOTREF(__pyx_t_8);
13012  __Pyx_XGOTREF(__pyx_t_9);
13013  __Pyx_XGOTREF(__pyx_t_10);
13014  __Pyx_XGOTREF(__pyx_t_11);
13015  __Pyx_XGOTREF(__pyx_t_12);
13016  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
13017  {
13018  PyMem_Free(__pyx_v_tmp);
13019  }
13020  if (PY_MAJOR_VERSION >= 3) {
13021  __Pyx_XGIVEREF(__pyx_t_10);
13022  __Pyx_XGIVEREF(__pyx_t_11);
13023  __Pyx_XGIVEREF(__pyx_t_12);
13024  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
13025  }
13026  __Pyx_XGIVEREF(__pyx_t_7);
13027  __Pyx_XGIVEREF(__pyx_t_8);
13028  __Pyx_XGIVEREF(__pyx_t_9);
13029  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
13030  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
13031  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
13032  goto __pyx_L1_error;
13033  }
13034  __pyx_L7:;
13035  }
13036 
13037  /* "View.MemoryView":449
13038  * src.ndim, dst.ndim, self.dtype_is_object)
13039  *
13040  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
13041  * cdef int array[128]
13042  * cdef void *tmp = NULL
13043  */
13044 
13045  /* function exit code */
13046  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13047  goto __pyx_L0;
13048  __pyx_L1_error:;
13049  __Pyx_XDECREF(__pyx_t_3);
13050  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
13051  __pyx_r = 0;
13052  __pyx_L0:;
13053  __Pyx_XGIVEREF(__pyx_r);
13054  __Pyx_RefNannyFinishContext();
13055  return __pyx_r;
13056 }
13057 
13058 /* "View.MemoryView":481
13059  * PyMem_Free(tmp)
13060  *
13061  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
13062  * cdef char *itemp = self.get_item_pointer(index)
13063  * self.assign_item_from_object(itemp, value)
13064  */
13065 
13066 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
13067  char *__pyx_v_itemp;
13068  PyObject *__pyx_r = NULL;
13069  __Pyx_RefNannyDeclarations
13070  char *__pyx_t_1;
13071  PyObject *__pyx_t_2 = NULL;
13072  __Pyx_RefNannySetupContext("setitem_indexed", 0);
13073 
13074  /* "View.MemoryView":482
13075  *
13076  * cdef setitem_indexed(self, index, value):
13077  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
13078  * self.assign_item_from_object(itemp, value)
13079  *
13080  */
13081  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error)
13082  __pyx_v_itemp = __pyx_t_1;
13083 
13084  /* "View.MemoryView":483
13085  * cdef setitem_indexed(self, index, value):
13086  * cdef char *itemp = self.get_item_pointer(index)
13087  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
13088  *
13089  * cdef convert_item_to_object(self, char *itemp):
13090  */
13091  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 483, __pyx_L1_error)
13092  __Pyx_GOTREF(__pyx_t_2);
13093  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13094 
13095  /* "View.MemoryView":481
13096  * PyMem_Free(tmp)
13097  *
13098  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
13099  * cdef char *itemp = self.get_item_pointer(index)
13100  * self.assign_item_from_object(itemp, value)
13101  */
13102 
13103  /* function exit code */
13104  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13105  goto __pyx_L0;
13106  __pyx_L1_error:;
13107  __Pyx_XDECREF(__pyx_t_2);
13108  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
13109  __pyx_r = 0;
13110  __pyx_L0:;
13111  __Pyx_XGIVEREF(__pyx_r);
13112  __Pyx_RefNannyFinishContext();
13113  return __pyx_r;
13114 }
13115 
13116 /* "View.MemoryView":485
13117  * self.assign_item_from_object(itemp, value)
13118  *
13119  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
13120  * """Only used if instantiated manually by the user, or if Cython doesn't
13121  * know how to convert the type"""
13122  */
13123 
13124 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
13125  PyObject *__pyx_v_struct = NULL;
13126  PyObject *__pyx_v_bytesitem = 0;
13127  PyObject *__pyx_v_result = NULL;
13128  PyObject *__pyx_r = NULL;
13129  __Pyx_RefNannyDeclarations
13130  PyObject *__pyx_t_1 = NULL;
13131  PyObject *__pyx_t_2 = NULL;
13132  PyObject *__pyx_t_3 = NULL;
13133  PyObject *__pyx_t_4 = NULL;
13134  PyObject *__pyx_t_5 = NULL;
13135  PyObject *__pyx_t_6 = NULL;
13136  PyObject *__pyx_t_7 = NULL;
13137  int __pyx_t_8;
13138  PyObject *__pyx_t_9 = NULL;
13139  size_t __pyx_t_10;
13140  int __pyx_t_11;
13141  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
13142 
13143  /* "View.MemoryView":488
13144  * """Only used if instantiated manually by the user, or if Cython doesn't
13145  * know how to convert the type"""
13146  * import struct # <<<<<<<<<<<<<<
13147  * cdef bytes bytesitem
13148  *
13149  */
13150  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error)
13151  __Pyx_GOTREF(__pyx_t_1);
13152  __pyx_v_struct = __pyx_t_1;
13153  __pyx_t_1 = 0;
13154 
13155  /* "View.MemoryView":491
13156  * cdef bytes bytesitem
13157  *
13158  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
13159  * try:
13160  * result = struct.unpack(self.view.format, bytesitem)
13161  */
13162  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 491, __pyx_L1_error)
13163  __Pyx_GOTREF(__pyx_t_1);
13164  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
13165  __pyx_t_1 = 0;
13166 
13167  /* "View.MemoryView":492
13168  *
13169  * bytesitem = itemp[:self.view.itemsize]
13170  * try: # <<<<<<<<<<<<<<
13171  * result = struct.unpack(self.view.format, bytesitem)
13172  * except struct.error:
13173  */
13174  {
13175  __Pyx_PyThreadState_declare
13176  __Pyx_PyThreadState_assign
13177  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
13178  __Pyx_XGOTREF(__pyx_t_2);
13179  __Pyx_XGOTREF(__pyx_t_3);
13180  __Pyx_XGOTREF(__pyx_t_4);
13181  /*try:*/ {
13182 
13183  /* "View.MemoryView":493
13184  * bytesitem = itemp[:self.view.itemsize]
13185  * try:
13186  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
13187  * except struct.error:
13188  * raise ValueError("Unable to convert item to object")
13189  */
13190  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L3_error)
13191  __Pyx_GOTREF(__pyx_t_5);
13192  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 493, __pyx_L3_error)
13193  __Pyx_GOTREF(__pyx_t_6);
13194  __pyx_t_7 = NULL;
13195  __pyx_t_8 = 0;
13196  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13197  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
13198  if (likely(__pyx_t_7)) {
13199  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
13200  __Pyx_INCREF(__pyx_t_7);
13201  __Pyx_INCREF(function);
13202  __Pyx_DECREF_SET(__pyx_t_5, function);
13203  __pyx_t_8 = 1;
13204  }
13205  }
13206  #if CYTHON_FAST_PYCALL
13207  if (PyFunction_Check(__pyx_t_5)) {
13208  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13209  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
13210  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13211  __Pyx_GOTREF(__pyx_t_1);
13212  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13213  } else
13214  #endif
13215  #if CYTHON_FAST_PYCCALL
13216  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
13217  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13218  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
13219  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13220  __Pyx_GOTREF(__pyx_t_1);
13221  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13222  } else
13223  #endif
13224  {
13225  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L3_error)
13226  __Pyx_GOTREF(__pyx_t_9);
13227  if (__pyx_t_7) {
13228  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
13229  }
13230  __Pyx_GIVEREF(__pyx_t_6);
13231  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
13232  __Pyx_INCREF(__pyx_v_bytesitem);
13233  __Pyx_GIVEREF(__pyx_v_bytesitem);
13234  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
13235  __pyx_t_6 = 0;
13236  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
13237  __Pyx_GOTREF(__pyx_t_1);
13238  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13239  }
13240  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13241  __pyx_v_result = __pyx_t_1;
13242  __pyx_t_1 = 0;
13243 
13244  /* "View.MemoryView":492
13245  *
13246  * bytesitem = itemp[:self.view.itemsize]
13247  * try: # <<<<<<<<<<<<<<
13248  * result = struct.unpack(self.view.format, bytesitem)
13249  * except struct.error:
13250  */
13251  }
13252 
13253  /* "View.MemoryView":497
13254  * raise ValueError("Unable to convert item to object")
13255  * else:
13256  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
13257  * return result[0]
13258  * return result
13259  */
13260  /*else:*/ {
13261  __pyx_t_10 = strlen(__pyx_v_self->view.format);
13262  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
13263  if (__pyx_t_11) {
13264 
13265  /* "View.MemoryView":498
13266  * else:
13267  * if len(self.view.format) == 1:
13268  * return result[0] # <<<<<<<<<<<<<<
13269  * return result
13270  *
13271  */
13272  __Pyx_XDECREF(__pyx_r);
13273  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error)
13274  __Pyx_GOTREF(__pyx_t_1);
13275  __pyx_r = __pyx_t_1;
13276  __pyx_t_1 = 0;
13277  goto __pyx_L6_except_return;
13278 
13279  /* "View.MemoryView":497
13280  * raise ValueError("Unable to convert item to object")
13281  * else:
13282  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
13283  * return result[0]
13284  * return result
13285  */
13286  }
13287 
13288  /* "View.MemoryView":499
13289  * if len(self.view.format) == 1:
13290  * return result[0]
13291  * return result # <<<<<<<<<<<<<<
13292  *
13293  * cdef assign_item_from_object(self, char *itemp, object value):
13294  */
13295  __Pyx_XDECREF(__pyx_r);
13296  __Pyx_INCREF(__pyx_v_result);
13297  __pyx_r = __pyx_v_result;
13298  goto __pyx_L6_except_return;
13299  }
13300  __pyx_L3_error:;
13301  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13302  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13303  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13304  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13305  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13306 
13307  /* "View.MemoryView":494
13308  * try:
13309  * result = struct.unpack(self.view.format, bytesitem)
13310  * except struct.error: # <<<<<<<<<<<<<<
13311  * raise ValueError("Unable to convert item to object")
13312  * else:
13313  */
13314  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
13315  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 494, __pyx_L5_except_error)
13316  __Pyx_GOTREF(__pyx_t_6);
13317  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
13318  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13319  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
13320  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
13321  if (__pyx_t_8) {
13322  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13323  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 494, __pyx_L5_except_error)
13324  __Pyx_GOTREF(__pyx_t_9);
13325  __Pyx_GOTREF(__pyx_t_5);
13326  __Pyx_GOTREF(__pyx_t_1);
13327 
13328  /* "View.MemoryView":495
13329  * result = struct.unpack(self.view.format, bytesitem)
13330  * except struct.error:
13331  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
13332  * else:
13333  * if len(self.view.format) == 1:
13334  */
13335  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L5_except_error)
13336  __Pyx_GOTREF(__pyx_t_6);
13337  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
13338  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13339  __PYX_ERR(2, 495, __pyx_L5_except_error)
13340  }
13341  goto __pyx_L5_except_error;
13342  __pyx_L5_except_error:;
13343 
13344  /* "View.MemoryView":492
13345  *
13346  * bytesitem = itemp[:self.view.itemsize]
13347  * try: # <<<<<<<<<<<<<<
13348  * result = struct.unpack(self.view.format, bytesitem)
13349  * except struct.error:
13350  */
13351  __Pyx_XGIVEREF(__pyx_t_2);
13352  __Pyx_XGIVEREF(__pyx_t_3);
13353  __Pyx_XGIVEREF(__pyx_t_4);
13354  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13355  goto __pyx_L1_error;
13356  __pyx_L6_except_return:;
13357  __Pyx_XGIVEREF(__pyx_t_2);
13358  __Pyx_XGIVEREF(__pyx_t_3);
13359  __Pyx_XGIVEREF(__pyx_t_4);
13360  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13361  goto __pyx_L0;
13362  }
13363 
13364  /* "View.MemoryView":485
13365  * self.assign_item_from_object(itemp, value)
13366  *
13367  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
13368  * """Only used if instantiated manually by the user, or if Cython doesn't
13369  * know how to convert the type"""
13370  */
13371 
13372  /* function exit code */
13373  __pyx_L1_error:;
13374  __Pyx_XDECREF(__pyx_t_1);
13375  __Pyx_XDECREF(__pyx_t_5);
13376  __Pyx_XDECREF(__pyx_t_6);
13377  __Pyx_XDECREF(__pyx_t_7);
13378  __Pyx_XDECREF(__pyx_t_9);
13379  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13380  __pyx_r = 0;
13381  __pyx_L0:;
13382  __Pyx_XDECREF(__pyx_v_struct);
13383  __Pyx_XDECREF(__pyx_v_bytesitem);
13384  __Pyx_XDECREF(__pyx_v_result);
13385  __Pyx_XGIVEREF(__pyx_r);
13386  __Pyx_RefNannyFinishContext();
13387  return __pyx_r;
13388 }
13389 
13390 /* "View.MemoryView":501
13391  * return result
13392  *
13393  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13394  * """Only used if instantiated manually by the user, or if Cython doesn't
13395  * know how to convert the type"""
13396  */
13397 
13398 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
13399  PyObject *__pyx_v_struct = NULL;
13400  char __pyx_v_c;
13401  PyObject *__pyx_v_bytesvalue = 0;
13402  Py_ssize_t __pyx_v_i;
13403  PyObject *__pyx_r = NULL;
13404  __Pyx_RefNannyDeclarations
13405  PyObject *__pyx_t_1 = NULL;
13406  int __pyx_t_2;
13407  int __pyx_t_3;
13408  PyObject *__pyx_t_4 = NULL;
13409  PyObject *__pyx_t_5 = NULL;
13410  PyObject *__pyx_t_6 = NULL;
13411  int __pyx_t_7;
13412  PyObject *__pyx_t_8 = NULL;
13413  Py_ssize_t __pyx_t_9;
13414  PyObject *__pyx_t_10 = NULL;
13415  char *__pyx_t_11;
13416  char *__pyx_t_12;
13417  char *__pyx_t_13;
13418  char *__pyx_t_14;
13419  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
13420 
13421  /* "View.MemoryView":504
13422  * """Only used if instantiated manually by the user, or if Cython doesn't
13423  * know how to convert the type"""
13424  * import struct # <<<<<<<<<<<<<<
13425  * cdef char c
13426  * cdef bytes bytesvalue
13427  */
13428  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 504, __pyx_L1_error)
13429  __Pyx_GOTREF(__pyx_t_1);
13430  __pyx_v_struct = __pyx_t_1;
13431  __pyx_t_1 = 0;
13432 
13433  /* "View.MemoryView":509
13434  * cdef Py_ssize_t i
13435  *
13436  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
13437  * bytesvalue = struct.pack(self.view.format, *value)
13438  * else:
13439  */
13440  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
13441  __pyx_t_3 = (__pyx_t_2 != 0);
13442  if (__pyx_t_3) {
13443 
13444  /* "View.MemoryView":510
13445  *
13446  * if isinstance(value, tuple):
13447  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
13448  * else:
13449  * bytesvalue = struct.pack(self.view.format, value)
13450  */
13451  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __pyx_L1_error)
13452  __Pyx_GOTREF(__pyx_t_1);
13453  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
13454  __Pyx_GOTREF(__pyx_t_4);
13455  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 510, __pyx_L1_error)
13456  __Pyx_GOTREF(__pyx_t_5);
13457  __Pyx_GIVEREF(__pyx_t_4);
13458  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13459  __pyx_t_4 = 0;
13460  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
13461  __Pyx_GOTREF(__pyx_t_4);
13462  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 510, __pyx_L1_error)
13463  __Pyx_GOTREF(__pyx_t_6);
13464  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13465  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13466  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
13467  __Pyx_GOTREF(__pyx_t_4);
13468  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13469  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13470  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 510, __pyx_L1_error)
13471  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13472  __pyx_t_4 = 0;
13473 
13474  /* "View.MemoryView":509
13475  * cdef Py_ssize_t i
13476  *
13477  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
13478  * bytesvalue = struct.pack(self.view.format, *value)
13479  * else:
13480  */
13481  goto __pyx_L3;
13482  }
13483 
13484  /* "View.MemoryView":512
13485  * bytesvalue = struct.pack(self.view.format, *value)
13486  * else:
13487  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
13488  *
13489  * for i, c in enumerate(bytesvalue):
13490  */
13491  /*else*/ {
13492  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error)
13493  __Pyx_GOTREF(__pyx_t_6);
13494  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error)
13495  __Pyx_GOTREF(__pyx_t_1);
13496  __pyx_t_5 = NULL;
13497  __pyx_t_7 = 0;
13498  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
13499  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13500  if (likely(__pyx_t_5)) {
13501  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
13502  __Pyx_INCREF(__pyx_t_5);
13503  __Pyx_INCREF(function);
13504  __Pyx_DECREF_SET(__pyx_t_6, function);
13505  __pyx_t_7 = 1;
13506  }
13507  }
13508  #if CYTHON_FAST_PYCALL
13509  if (PyFunction_Check(__pyx_t_6)) {
13510  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13511  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
13512  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13513  __Pyx_GOTREF(__pyx_t_4);
13514  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13515  } else
13516  #endif
13517  #if CYTHON_FAST_PYCCALL
13518  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13519  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13520  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
13521  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13522  __Pyx_GOTREF(__pyx_t_4);
13523  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13524  } else
13525  #endif
13526  {
13527  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 512, __pyx_L1_error)
13528  __Pyx_GOTREF(__pyx_t_8);
13529  if (__pyx_t_5) {
13530  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13531  }
13532  __Pyx_GIVEREF(__pyx_t_1);
13533  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
13534  __Pyx_INCREF(__pyx_v_value);
13535  __Pyx_GIVEREF(__pyx_v_value);
13536  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
13537  __pyx_t_1 = 0;
13538  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
13539  __Pyx_GOTREF(__pyx_t_4);
13540  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13541  }
13542  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13543  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error)
13544  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13545  __pyx_t_4 = 0;
13546  }
13547  __pyx_L3:;
13548 
13549  /* "View.MemoryView":514
13550  * bytesvalue = struct.pack(self.view.format, value)
13551  *
13552  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13553  * itemp[i] = c
13554  *
13555  */
13556  __pyx_t_9 = 0;
13557  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
13558  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
13559  __PYX_ERR(2, 514, __pyx_L1_error)
13560  }
13561  __Pyx_INCREF(__pyx_v_bytesvalue);
13562  __pyx_t_10 = __pyx_v_bytesvalue;
13563  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
13564  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
13565  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
13566  __pyx_t_11 = __pyx_t_14;
13567  __pyx_v_c = (__pyx_t_11[0]);
13568 
13569  /* "View.MemoryView":515
13570  *
13571  * for i, c in enumerate(bytesvalue):
13572  * itemp[i] = c # <<<<<<<<<<<<<<
13573  *
13574  * @cname('getbuffer')
13575  */
13576  __pyx_v_i = __pyx_t_9;
13577 
13578  /* "View.MemoryView":514
13579  * bytesvalue = struct.pack(self.view.format, value)
13580  *
13581  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13582  * itemp[i] = c
13583  *
13584  */
13585  __pyx_t_9 = (__pyx_t_9 + 1);
13586 
13587  /* "View.MemoryView":515
13588  *
13589  * for i, c in enumerate(bytesvalue):
13590  * itemp[i] = c # <<<<<<<<<<<<<<
13591  *
13592  * @cname('getbuffer')
13593  */
13594  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
13595  }
13596  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13597 
13598  /* "View.MemoryView":501
13599  * return result
13600  *
13601  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13602  * """Only used if instantiated manually by the user, or if Cython doesn't
13603  * know how to convert the type"""
13604  */
13605 
13606  /* function exit code */
13607  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13608  goto __pyx_L0;
13609  __pyx_L1_error:;
13610  __Pyx_XDECREF(__pyx_t_1);
13611  __Pyx_XDECREF(__pyx_t_4);
13612  __Pyx_XDECREF(__pyx_t_5);
13613  __Pyx_XDECREF(__pyx_t_6);
13614  __Pyx_XDECREF(__pyx_t_8);
13615  __Pyx_XDECREF(__pyx_t_10);
13616  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13617  __pyx_r = 0;
13618  __pyx_L0:;
13619  __Pyx_XDECREF(__pyx_v_struct);
13620  __Pyx_XDECREF(__pyx_v_bytesvalue);
13621  __Pyx_XGIVEREF(__pyx_r);
13622  __Pyx_RefNannyFinishContext();
13623  return __pyx_r;
13624 }
13625 
13626 /* "View.MemoryView":518
13627  *
13628  * @cname('getbuffer')
13629  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13630  * if flags & PyBUF_WRITABLE and self.view.readonly:
13631  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13632  */
13633 
13634 /* Python wrapper */
13635 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
13636 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13637  int __pyx_r;
13638  __Pyx_RefNannyDeclarations
13639  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
13640  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
13641 
13642  /* function exit code */
13643  __Pyx_RefNannyFinishContext();
13644  return __pyx_r;
13645 }
13646 
13647 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13648  int __pyx_r;
13649  __Pyx_RefNannyDeclarations
13650  int __pyx_t_1;
13651  int __pyx_t_2;
13652  PyObject *__pyx_t_3 = NULL;
13653  Py_ssize_t *__pyx_t_4;
13654  char *__pyx_t_5;
13655  void *__pyx_t_6;
13656  int __pyx_t_7;
13657  Py_ssize_t __pyx_t_8;
13658  if (__pyx_v_info == NULL) {
13659  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
13660  return -1;
13661  }
13662  __Pyx_RefNannySetupContext("__getbuffer__", 0);
13663  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13664  __Pyx_GIVEREF(__pyx_v_info->obj);
13665 
13666  /* "View.MemoryView":519
13667  * @cname('getbuffer')
13668  * def __getbuffer__(self, Py_buffer *info, int flags):
13669  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13670  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13671  *
13672  */
13673  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13674  if (__pyx_t_2) {
13675  } else {
13676  __pyx_t_1 = __pyx_t_2;
13677  goto __pyx_L4_bool_binop_done;
13678  }
13679  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13680  __pyx_t_1 = __pyx_t_2;
13681  __pyx_L4_bool_binop_done:;
13682  if (unlikely(__pyx_t_1)) {
13683 
13684  /* "View.MemoryView":520
13685  * def __getbuffer__(self, Py_buffer *info, int flags):
13686  * if flags & PyBUF_WRITABLE and self.view.readonly:
13687  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
13688  *
13689  * if flags & PyBUF_ND:
13690  */
13691  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error)
13692  __Pyx_GOTREF(__pyx_t_3);
13693  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13694  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13695  __PYX_ERR(2, 520, __pyx_L1_error)
13696 
13697  /* "View.MemoryView":519
13698  * @cname('getbuffer')
13699  * def __getbuffer__(self, Py_buffer *info, int flags):
13700  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13701  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13702  *
13703  */
13704  }
13705 
13706  /* "View.MemoryView":522
13707  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13708  *
13709  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13710  * info.shape = self.view.shape
13711  * else:
13712  */
13713  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
13714  if (__pyx_t_1) {
13715 
13716  /* "View.MemoryView":523
13717  *
13718  * if flags & PyBUF_ND:
13719  * info.shape = self.view.shape # <<<<<<<<<<<<<<
13720  * else:
13721  * info.shape = NULL
13722  */
13723  __pyx_t_4 = __pyx_v_self->view.shape;
13724  __pyx_v_info->shape = __pyx_t_4;
13725 
13726  /* "View.MemoryView":522
13727  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13728  *
13729  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13730  * info.shape = self.view.shape
13731  * else:
13732  */
13733  goto __pyx_L6;
13734  }
13735 
13736  /* "View.MemoryView":525
13737  * info.shape = self.view.shape
13738  * else:
13739  * info.shape = NULL # <<<<<<<<<<<<<<
13740  *
13741  * if flags & PyBUF_STRIDES:
13742  */
13743  /*else*/ {
13744  __pyx_v_info->shape = NULL;
13745  }
13746  __pyx_L6:;
13747 
13748  /* "View.MemoryView":527
13749  * info.shape = NULL
13750  *
13751  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13752  * info.strides = self.view.strides
13753  * else:
13754  */
13755  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13756  if (__pyx_t_1) {
13757 
13758  /* "View.MemoryView":528
13759  *
13760  * if flags & PyBUF_STRIDES:
13761  * info.strides = self.view.strides # <<<<<<<<<<<<<<
13762  * else:
13763  * info.strides = NULL
13764  */
13765  __pyx_t_4 = __pyx_v_self->view.strides;
13766  __pyx_v_info->strides = __pyx_t_4;
13767 
13768  /* "View.MemoryView":527
13769  * info.shape = NULL
13770  *
13771  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13772  * info.strides = self.view.strides
13773  * else:
13774  */
13775  goto __pyx_L7;
13776  }
13777 
13778  /* "View.MemoryView":530
13779  * info.strides = self.view.strides
13780  * else:
13781  * info.strides = NULL # <<<<<<<<<<<<<<
13782  *
13783  * if flags & PyBUF_INDIRECT:
13784  */
13785  /*else*/ {
13786  __pyx_v_info->strides = NULL;
13787  }
13788  __pyx_L7:;
13789 
13790  /* "View.MemoryView":532
13791  * info.strides = NULL
13792  *
13793  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13794  * info.suboffsets = self.view.suboffsets
13795  * else:
13796  */
13797  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13798  if (__pyx_t_1) {
13799 
13800  /* "View.MemoryView":533
13801  *
13802  * if flags & PyBUF_INDIRECT:
13803  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
13804  * else:
13805  * info.suboffsets = NULL
13806  */
13807  __pyx_t_4 = __pyx_v_self->view.suboffsets;
13808  __pyx_v_info->suboffsets = __pyx_t_4;
13809 
13810  /* "View.MemoryView":532
13811  * info.strides = NULL
13812  *
13813  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13814  * info.suboffsets = self.view.suboffsets
13815  * else:
13816  */
13817  goto __pyx_L8;
13818  }
13819 
13820  /* "View.MemoryView":535
13821  * info.suboffsets = self.view.suboffsets
13822  * else:
13823  * info.suboffsets = NULL # <<<<<<<<<<<<<<
13824  *
13825  * if flags & PyBUF_FORMAT:
13826  */
13827  /*else*/ {
13828  __pyx_v_info->suboffsets = NULL;
13829  }
13830  __pyx_L8:;
13831 
13832  /* "View.MemoryView":537
13833  * info.suboffsets = NULL
13834  *
13835  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13836  * info.format = self.view.format
13837  * else:
13838  */
13839  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13840  if (__pyx_t_1) {
13841 
13842  /* "View.MemoryView":538
13843  *
13844  * if flags & PyBUF_FORMAT:
13845  * info.format = self.view.format # <<<<<<<<<<<<<<
13846  * else:
13847  * info.format = NULL
13848  */
13849  __pyx_t_5 = __pyx_v_self->view.format;
13850  __pyx_v_info->format = __pyx_t_5;
13851 
13852  /* "View.MemoryView":537
13853  * info.suboffsets = NULL
13854  *
13855  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13856  * info.format = self.view.format
13857  * else:
13858  */
13859  goto __pyx_L9;
13860  }
13861 
13862  /* "View.MemoryView":540
13863  * info.format = self.view.format
13864  * else:
13865  * info.format = NULL # <<<<<<<<<<<<<<
13866  *
13867  * info.buf = self.view.buf
13868  */
13869  /*else*/ {
13870  __pyx_v_info->format = NULL;
13871  }
13872  __pyx_L9:;
13873 
13874  /* "View.MemoryView":542
13875  * info.format = NULL
13876  *
13877  * info.buf = self.view.buf # <<<<<<<<<<<<<<
13878  * info.ndim = self.view.ndim
13879  * info.itemsize = self.view.itemsize
13880  */
13881  __pyx_t_6 = __pyx_v_self->view.buf;
13882  __pyx_v_info->buf = __pyx_t_6;
13883 
13884  /* "View.MemoryView":543
13885  *
13886  * info.buf = self.view.buf
13887  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
13888  * info.itemsize = self.view.itemsize
13889  * info.len = self.view.len
13890  */
13891  __pyx_t_7 = __pyx_v_self->view.ndim;
13892  __pyx_v_info->ndim = __pyx_t_7;
13893 
13894  /* "View.MemoryView":544
13895  * info.buf = self.view.buf
13896  * info.ndim = self.view.ndim
13897  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
13898  * info.len = self.view.len
13899  * info.readonly = self.view.readonly
13900  */
13901  __pyx_t_8 = __pyx_v_self->view.itemsize;
13902  __pyx_v_info->itemsize = __pyx_t_8;
13903 
13904  /* "View.MemoryView":545
13905  * info.ndim = self.view.ndim
13906  * info.itemsize = self.view.itemsize
13907  * info.len = self.view.len # <<<<<<<<<<<<<<
13908  * info.readonly = self.view.readonly
13909  * info.obj = self
13910  */
13911  __pyx_t_8 = __pyx_v_self->view.len;
13912  __pyx_v_info->len = __pyx_t_8;
13913 
13914  /* "View.MemoryView":546
13915  * info.itemsize = self.view.itemsize
13916  * info.len = self.view.len
13917  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
13918  * info.obj = self
13919  *
13920  */
13921  __pyx_t_1 = __pyx_v_self->view.readonly;
13922  __pyx_v_info->readonly = __pyx_t_1;
13923 
13924  /* "View.MemoryView":547
13925  * info.len = self.view.len
13926  * info.readonly = self.view.readonly
13927  * info.obj = self # <<<<<<<<<<<<<<
13928  *
13929  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
13930  */
13931  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13932  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13933  __Pyx_GOTREF(__pyx_v_info->obj);
13934  __Pyx_DECREF(__pyx_v_info->obj);
13935  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13936 
13937  /* "View.MemoryView":518
13938  *
13939  * @cname('getbuffer')
13940  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13941  * if flags & PyBUF_WRITABLE and self.view.readonly:
13942  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13943  */
13944 
13945  /* function exit code */
13946  __pyx_r = 0;
13947  goto __pyx_L0;
13948  __pyx_L1_error:;
13949  __Pyx_XDECREF(__pyx_t_3);
13950  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13951  __pyx_r = -1;
13952  if (__pyx_v_info->obj != NULL) {
13953  __Pyx_GOTREF(__pyx_v_info->obj);
13954  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13955  }
13956  goto __pyx_L2;
13957  __pyx_L0:;
13958  if (__pyx_v_info->obj == Py_None) {
13959  __Pyx_GOTREF(__pyx_v_info->obj);
13960  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13961  }
13962  __pyx_L2:;
13963  __Pyx_RefNannyFinishContext();
13964  return __pyx_r;
13965 }
13966 
13967 /* "View.MemoryView":553
13968  *
13969  * @property
13970  * def T(self): # <<<<<<<<<<<<<<
13971  * cdef _memoryviewslice result = memoryview_copy(self)
13972  * transpose_memslice(&result.from_slice)
13973  */
13974 
13975 /* Python wrapper */
13976 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
13977 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13978  PyObject *__pyx_r = 0;
13979  __Pyx_RefNannyDeclarations
13980  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13981  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13982 
13983  /* function exit code */
13984  __Pyx_RefNannyFinishContext();
13985  return __pyx_r;
13986 }
13987 
13988 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13989  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13990  PyObject *__pyx_r = NULL;
13991  __Pyx_RefNannyDeclarations
13992  PyObject *__pyx_t_1 = NULL;
13993  int __pyx_t_2;
13994  __Pyx_RefNannySetupContext("__get__", 0);
13995 
13996  /* "View.MemoryView":554
13997  * @property
13998  * def T(self):
13999  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
14000  * transpose_memslice(&result.from_slice)
14001  * return result
14002  */
14003  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 554, __pyx_L1_error)
14004  __Pyx_GOTREF(__pyx_t_1);
14005  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 554, __pyx_L1_error)
14006  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
14007  __pyx_t_1 = 0;
14008 
14009  /* "View.MemoryView":555
14010  * def T(self):
14011  * cdef _memoryviewslice result = memoryview_copy(self)
14012  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
14013  * return result
14014  *
14015  */
14016  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error)
14017 
14018  /* "View.MemoryView":556
14019  * cdef _memoryviewslice result = memoryview_copy(self)
14020  * transpose_memslice(&result.from_slice)
14021  * return result # <<<<<<<<<<<<<<
14022  *
14023  * @property
14024  */
14025  __Pyx_XDECREF(__pyx_r);
14026  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14027  __pyx_r = ((PyObject *)__pyx_v_result);
14028  goto __pyx_L0;
14029 
14030  /* "View.MemoryView":553
14031  *
14032  * @property
14033  * def T(self): # <<<<<<<<<<<<<<
14034  * cdef _memoryviewslice result = memoryview_copy(self)
14035  * transpose_memslice(&result.from_slice)
14036  */
14037 
14038  /* function exit code */
14039  __pyx_L1_error:;
14040  __Pyx_XDECREF(__pyx_t_1);
14041  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14042  __pyx_r = NULL;
14043  __pyx_L0:;
14044  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14045  __Pyx_XGIVEREF(__pyx_r);
14046  __Pyx_RefNannyFinishContext();
14047  return __pyx_r;
14048 }
14049 
14050 /* "View.MemoryView":559
14051  *
14052  * @property
14053  * def base(self): # <<<<<<<<<<<<<<
14054  * return self.obj
14055  *
14056  */
14057 
14058 /* Python wrapper */
14059 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
14060 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
14061  PyObject *__pyx_r = 0;
14062  __Pyx_RefNannyDeclarations
14063  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14064  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14065 
14066  /* function exit code */
14067  __Pyx_RefNannyFinishContext();
14068  return __pyx_r;
14069 }
14070 
14071 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14072  PyObject *__pyx_r = NULL;
14073  __Pyx_RefNannyDeclarations
14074  __Pyx_RefNannySetupContext("__get__", 0);
14075 
14076  /* "View.MemoryView":560
14077  * @property
14078  * def base(self):
14079  * return self.obj # <<<<<<<<<<<<<<
14080  *
14081  * @property
14082  */
14083  __Pyx_XDECREF(__pyx_r);
14084  __Pyx_INCREF(__pyx_v_self->obj);
14085  __pyx_r = __pyx_v_self->obj;
14086  goto __pyx_L0;
14087 
14088  /* "View.MemoryView":559
14089  *
14090  * @property
14091  * def base(self): # <<<<<<<<<<<<<<
14092  * return self.obj
14093  *
14094  */
14095 
14096  /* function exit code */
14097  __pyx_L0:;
14098  __Pyx_XGIVEREF(__pyx_r);
14099  __Pyx_RefNannyFinishContext();
14100  return __pyx_r;
14101 }
14102 
14103 /* "View.MemoryView":563
14104  *
14105  * @property
14106  * def shape(self): # <<<<<<<<<<<<<<
14107  * return tuple([length for length in self.view.shape[:self.view.ndim]])
14108  *
14109  */
14110 
14111 /* Python wrapper */
14112 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
14113 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
14114  PyObject *__pyx_r = 0;
14115  __Pyx_RefNannyDeclarations
14116  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14117  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14118 
14119  /* function exit code */
14120  __Pyx_RefNannyFinishContext();
14121  return __pyx_r;
14122 }
14123 
14124 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14125  Py_ssize_t __pyx_v_length;
14126  PyObject *__pyx_r = NULL;
14127  __Pyx_RefNannyDeclarations
14128  PyObject *__pyx_t_1 = NULL;
14129  Py_ssize_t *__pyx_t_2;
14130  Py_ssize_t *__pyx_t_3;
14131  Py_ssize_t *__pyx_t_4;
14132  PyObject *__pyx_t_5 = NULL;
14133  __Pyx_RefNannySetupContext("__get__", 0);
14134 
14135  /* "View.MemoryView":564
14136  * @property
14137  * def shape(self):
14138  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
14139  *
14140  * @property
14141  */
14142  __Pyx_XDECREF(__pyx_r);
14143  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error)
14144  __Pyx_GOTREF(__pyx_t_1);
14145  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14146  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
14147  __pyx_t_2 = __pyx_t_4;
14148  __pyx_v_length = (__pyx_t_2[0]);
14149  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
14150  __Pyx_GOTREF(__pyx_t_5);
14151  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 564, __pyx_L1_error)
14152  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14153  }
14154  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
14155  __Pyx_GOTREF(__pyx_t_5);
14156  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14157  __pyx_r = __pyx_t_5;
14158  __pyx_t_5 = 0;
14159  goto __pyx_L0;
14160 
14161  /* "View.MemoryView":563
14162  *
14163  * @property
14164  * def shape(self): # <<<<<<<<<<<<<<
14165  * return tuple([length for length in self.view.shape[:self.view.ndim]])
14166  *
14167  */
14168 
14169  /* function exit code */
14170  __pyx_L1_error:;
14171  __Pyx_XDECREF(__pyx_t_1);
14172  __Pyx_XDECREF(__pyx_t_5);
14173  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14174  __pyx_r = NULL;
14175  __pyx_L0:;
14176  __Pyx_XGIVEREF(__pyx_r);
14177  __Pyx_RefNannyFinishContext();
14178  return __pyx_r;
14179 }
14180 
14181 /* "View.MemoryView":567
14182  *
14183  * @property
14184  * def strides(self): # <<<<<<<<<<<<<<
14185  * if self.view.strides == NULL:
14186  *
14187  */
14188 
14189 /* Python wrapper */
14190 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
14191 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
14192  PyObject *__pyx_r = 0;
14193  __Pyx_RefNannyDeclarations
14194  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14195  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14196 
14197  /* function exit code */
14198  __Pyx_RefNannyFinishContext();
14199  return __pyx_r;
14200 }
14201 
14202 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14203  Py_ssize_t __pyx_v_stride;
14204  PyObject *__pyx_r = NULL;
14205  __Pyx_RefNannyDeclarations
14206  int __pyx_t_1;
14207  PyObject *__pyx_t_2 = NULL;
14208  Py_ssize_t *__pyx_t_3;
14209  Py_ssize_t *__pyx_t_4;
14210  Py_ssize_t *__pyx_t_5;
14211  PyObject *__pyx_t_6 = NULL;
14212  __Pyx_RefNannySetupContext("__get__", 0);
14213 
14214  /* "View.MemoryView":568
14215  * @property
14216  * def strides(self):
14217  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
14218  *
14219  * raise ValueError("Buffer view does not expose strides")
14220  */
14221  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
14222  if (unlikely(__pyx_t_1)) {
14223 
14224  /* "View.MemoryView":570
14225  * if self.view.strides == NULL:
14226  *
14227  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
14228  *
14229  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
14230  */
14231  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error)
14232  __Pyx_GOTREF(__pyx_t_2);
14233  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
14234  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14235  __PYX_ERR(2, 570, __pyx_L1_error)
14236 
14237  /* "View.MemoryView":568
14238  * @property
14239  * def strides(self):
14240  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
14241  *
14242  * raise ValueError("Buffer view does not expose strides")
14243  */
14244  }
14245 
14246  /* "View.MemoryView":572
14247  * raise ValueError("Buffer view does not expose strides")
14248  *
14249  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
14250  *
14251  * @property
14252  */
14253  __Pyx_XDECREF(__pyx_r);
14254  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error)
14255  __Pyx_GOTREF(__pyx_t_2);
14256  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
14257  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14258  __pyx_t_3 = __pyx_t_5;
14259  __pyx_v_stride = (__pyx_t_3[0]);
14260  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
14261  __Pyx_GOTREF(__pyx_t_6);
14262  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 572, __pyx_L1_error)
14263  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14264  }
14265  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
14266  __Pyx_GOTREF(__pyx_t_6);
14267  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14268  __pyx_r = __pyx_t_6;
14269  __pyx_t_6 = 0;
14270  goto __pyx_L0;
14271 
14272  /* "View.MemoryView":567
14273  *
14274  * @property
14275  * def strides(self): # <<<<<<<<<<<<<<
14276  * if self.view.strides == NULL:
14277  *
14278  */
14279 
14280  /* function exit code */
14281  __pyx_L1_error:;
14282  __Pyx_XDECREF(__pyx_t_2);
14283  __Pyx_XDECREF(__pyx_t_6);
14284  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14285  __pyx_r = NULL;
14286  __pyx_L0:;
14287  __Pyx_XGIVEREF(__pyx_r);
14288  __Pyx_RefNannyFinishContext();
14289  return __pyx_r;
14290 }
14291 
14292 /* "View.MemoryView":575
14293  *
14294  * @property
14295  * def suboffsets(self): # <<<<<<<<<<<<<<
14296  * if self.view.suboffsets == NULL:
14297  * return (-1,) * self.view.ndim
14298  */
14299 
14300 /* Python wrapper */
14301 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
14302 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
14303  PyObject *__pyx_r = 0;
14304  __Pyx_RefNannyDeclarations
14305  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14306  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14307 
14308  /* function exit code */
14309  __Pyx_RefNannyFinishContext();
14310  return __pyx_r;
14311 }
14312 
14313 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14314  Py_ssize_t __pyx_v_suboffset;
14315  PyObject *__pyx_r = NULL;
14316  __Pyx_RefNannyDeclarations
14317  int __pyx_t_1;
14318  PyObject *__pyx_t_2 = NULL;
14319  PyObject *__pyx_t_3 = NULL;
14320  Py_ssize_t *__pyx_t_4;
14321  Py_ssize_t *__pyx_t_5;
14322  Py_ssize_t *__pyx_t_6;
14323  __Pyx_RefNannySetupContext("__get__", 0);
14324 
14325  /* "View.MemoryView":576
14326  * @property
14327  * def suboffsets(self):
14328  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
14329  * return (-1,) * self.view.ndim
14330  *
14331  */
14332  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
14333  if (__pyx_t_1) {
14334 
14335  /* "View.MemoryView":577
14336  * def suboffsets(self):
14337  * if self.view.suboffsets == NULL:
14338  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
14339  *
14340  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
14341  */
14342  __Pyx_XDECREF(__pyx_r);
14343  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error)
14344  __Pyx_GOTREF(__pyx_t_2);
14345  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__19, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error)
14346  __Pyx_GOTREF(__pyx_t_3);
14347  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14348  __pyx_r = __pyx_t_3;
14349  __pyx_t_3 = 0;
14350  goto __pyx_L0;
14351 
14352  /* "View.MemoryView":576
14353  * @property
14354  * def suboffsets(self):
14355  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
14356  * return (-1,) * self.view.ndim
14357  *
14358  */
14359  }
14360 
14361  /* "View.MemoryView":579
14362  * return (-1,) * self.view.ndim
14363  *
14364  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
14365  *
14366  * @property
14367  */
14368  __Pyx_XDECREF(__pyx_r);
14369  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error)
14370  __Pyx_GOTREF(__pyx_t_3);
14371  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
14372  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
14373  __pyx_t_4 = __pyx_t_6;
14374  __pyx_v_suboffset = (__pyx_t_4[0]);
14375  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
14376  __Pyx_GOTREF(__pyx_t_2);
14377  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 579, __pyx_L1_error)
14378  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14379  }
14380  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
14381  __Pyx_GOTREF(__pyx_t_2);
14382  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14383  __pyx_r = __pyx_t_2;
14384  __pyx_t_2 = 0;
14385  goto __pyx_L0;
14386 
14387  /* "View.MemoryView":575
14388  *
14389  * @property
14390  * def suboffsets(self): # <<<<<<<<<<<<<<
14391  * if self.view.suboffsets == NULL:
14392  * return (-1,) * self.view.ndim
14393  */
14394 
14395  /* function exit code */
14396  __pyx_L1_error:;
14397  __Pyx_XDECREF(__pyx_t_2);
14398  __Pyx_XDECREF(__pyx_t_3);
14399  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14400  __pyx_r = NULL;
14401  __pyx_L0:;
14402  __Pyx_XGIVEREF(__pyx_r);
14403  __Pyx_RefNannyFinishContext();
14404  return __pyx_r;
14405 }
14406 
14407 /* "View.MemoryView":582
14408  *
14409  * @property
14410  * def ndim(self): # <<<<<<<<<<<<<<
14411  * return self.view.ndim
14412  *
14413  */
14414 
14415 /* Python wrapper */
14416 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
14417 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
14418  PyObject *__pyx_r = 0;
14419  __Pyx_RefNannyDeclarations
14420  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14421  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14422 
14423  /* function exit code */
14424  __Pyx_RefNannyFinishContext();
14425  return __pyx_r;
14426 }
14427 
14428 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14429  PyObject *__pyx_r = NULL;
14430  __Pyx_RefNannyDeclarations
14431  PyObject *__pyx_t_1 = NULL;
14432  __Pyx_RefNannySetupContext("__get__", 0);
14433 
14434  /* "View.MemoryView":583
14435  * @property
14436  * def ndim(self):
14437  * return self.view.ndim # <<<<<<<<<<<<<<
14438  *
14439  * @property
14440  */
14441  __Pyx_XDECREF(__pyx_r);
14442  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error)
14443  __Pyx_GOTREF(__pyx_t_1);
14444  __pyx_r = __pyx_t_1;
14445  __pyx_t_1 = 0;
14446  goto __pyx_L0;
14447 
14448  /* "View.MemoryView":582
14449  *
14450  * @property
14451  * def ndim(self): # <<<<<<<<<<<<<<
14452  * return self.view.ndim
14453  *
14454  */
14455 
14456  /* function exit code */
14457  __pyx_L1_error:;
14458  __Pyx_XDECREF(__pyx_t_1);
14459  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14460  __pyx_r = NULL;
14461  __pyx_L0:;
14462  __Pyx_XGIVEREF(__pyx_r);
14463  __Pyx_RefNannyFinishContext();
14464  return __pyx_r;
14465 }
14466 
14467 /* "View.MemoryView":586
14468  *
14469  * @property
14470  * def itemsize(self): # <<<<<<<<<<<<<<
14471  * return self.view.itemsize
14472  *
14473  */
14474 
14475 /* Python wrapper */
14476 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
14477 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
14478  PyObject *__pyx_r = 0;
14479  __Pyx_RefNannyDeclarations
14480  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14481  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14482 
14483  /* function exit code */
14484  __Pyx_RefNannyFinishContext();
14485  return __pyx_r;
14486 }
14487 
14488 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14489  PyObject *__pyx_r = NULL;
14490  __Pyx_RefNannyDeclarations
14491  PyObject *__pyx_t_1 = NULL;
14492  __Pyx_RefNannySetupContext("__get__", 0);
14493 
14494  /* "View.MemoryView":587
14495  * @property
14496  * def itemsize(self):
14497  * return self.view.itemsize # <<<<<<<<<<<<<<
14498  *
14499  * @property
14500  */
14501  __Pyx_XDECREF(__pyx_r);
14502  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error)
14503  __Pyx_GOTREF(__pyx_t_1);
14504  __pyx_r = __pyx_t_1;
14505  __pyx_t_1 = 0;
14506  goto __pyx_L0;
14507 
14508  /* "View.MemoryView":586
14509  *
14510  * @property
14511  * def itemsize(self): # <<<<<<<<<<<<<<
14512  * return self.view.itemsize
14513  *
14514  */
14515 
14516  /* function exit code */
14517  __pyx_L1_error:;
14518  __Pyx_XDECREF(__pyx_t_1);
14519  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14520  __pyx_r = NULL;
14521  __pyx_L0:;
14522  __Pyx_XGIVEREF(__pyx_r);
14523  __Pyx_RefNannyFinishContext();
14524  return __pyx_r;
14525 }
14526 
14527 /* "View.MemoryView":590
14528  *
14529  * @property
14530  * def nbytes(self): # <<<<<<<<<<<<<<
14531  * return self.size * self.view.itemsize
14532  *
14533  */
14534 
14535 /* Python wrapper */
14536 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
14537 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
14538  PyObject *__pyx_r = 0;
14539  __Pyx_RefNannyDeclarations
14540  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14541  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14542 
14543  /* function exit code */
14544  __Pyx_RefNannyFinishContext();
14545  return __pyx_r;
14546 }
14547 
14548 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14549  PyObject *__pyx_r = NULL;
14550  __Pyx_RefNannyDeclarations
14551  PyObject *__pyx_t_1 = NULL;
14552  PyObject *__pyx_t_2 = NULL;
14553  PyObject *__pyx_t_3 = NULL;
14554  __Pyx_RefNannySetupContext("__get__", 0);
14555 
14556  /* "View.MemoryView":591
14557  * @property
14558  * def nbytes(self):
14559  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
14560  *
14561  * @property
14562  */
14563  __Pyx_XDECREF(__pyx_r);
14564  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 591, __pyx_L1_error)
14565  __Pyx_GOTREF(__pyx_t_1);
14566  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 591, __pyx_L1_error)
14567  __Pyx_GOTREF(__pyx_t_2);
14568  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 591, __pyx_L1_error)
14569  __Pyx_GOTREF(__pyx_t_3);
14570  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14571  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14572  __pyx_r = __pyx_t_3;
14573  __pyx_t_3 = 0;
14574  goto __pyx_L0;
14575 
14576  /* "View.MemoryView":590
14577  *
14578  * @property
14579  * def nbytes(self): # <<<<<<<<<<<<<<
14580  * return self.size * self.view.itemsize
14581  *
14582  */
14583 
14584  /* function exit code */
14585  __pyx_L1_error:;
14586  __Pyx_XDECREF(__pyx_t_1);
14587  __Pyx_XDECREF(__pyx_t_2);
14588  __Pyx_XDECREF(__pyx_t_3);
14589  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14590  __pyx_r = NULL;
14591  __pyx_L0:;
14592  __Pyx_XGIVEREF(__pyx_r);
14593  __Pyx_RefNannyFinishContext();
14594  return __pyx_r;
14595 }
14596 
14597 /* "View.MemoryView":594
14598  *
14599  * @property
14600  * def size(self): # <<<<<<<<<<<<<<
14601  * if self._size is None:
14602  * result = 1
14603  */
14604 
14605 /* Python wrapper */
14606 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
14607 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14608  PyObject *__pyx_r = 0;
14609  __Pyx_RefNannyDeclarations
14610  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14611  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14612 
14613  /* function exit code */
14614  __Pyx_RefNannyFinishContext();
14615  return __pyx_r;
14616 }
14617 
14618 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14619  PyObject *__pyx_v_result = NULL;
14620  PyObject *__pyx_v_length = NULL;
14621  PyObject *__pyx_r = NULL;
14622  __Pyx_RefNannyDeclarations
14623  int __pyx_t_1;
14624  int __pyx_t_2;
14625  Py_ssize_t *__pyx_t_3;
14626  Py_ssize_t *__pyx_t_4;
14627  Py_ssize_t *__pyx_t_5;
14628  PyObject *__pyx_t_6 = NULL;
14629  __Pyx_RefNannySetupContext("__get__", 0);
14630 
14631  /* "View.MemoryView":595
14632  * @property
14633  * def size(self):
14634  * if self._size is None: # <<<<<<<<<<<<<<
14635  * result = 1
14636  *
14637  */
14638  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14639  __pyx_t_2 = (__pyx_t_1 != 0);
14640  if (__pyx_t_2) {
14641 
14642  /* "View.MemoryView":596
14643  * def size(self):
14644  * if self._size is None:
14645  * result = 1 # <<<<<<<<<<<<<<
14646  *
14647  * for length in self.view.shape[:self.view.ndim]:
14648  */
14649  __Pyx_INCREF(__pyx_int_1);
14650  __pyx_v_result = __pyx_int_1;
14651 
14652  /* "View.MemoryView":598
14653  * result = 1
14654  *
14655  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
14656  * result *= length
14657  *
14658  */
14659  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14660  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14661  __pyx_t_3 = __pyx_t_5;
14662  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 598, __pyx_L1_error)
14663  __Pyx_GOTREF(__pyx_t_6);
14664  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14665  __pyx_t_6 = 0;
14666 
14667  /* "View.MemoryView":599
14668  *
14669  * for length in self.view.shape[:self.view.ndim]:
14670  * result *= length # <<<<<<<<<<<<<<
14671  *
14672  * self._size = result
14673  */
14674  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 599, __pyx_L1_error)
14675  __Pyx_GOTREF(__pyx_t_6);
14676  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14677  __pyx_t_6 = 0;
14678  }
14679 
14680  /* "View.MemoryView":601
14681  * result *= length
14682  *
14683  * self._size = result # <<<<<<<<<<<<<<
14684  *
14685  * return self._size
14686  */
14687  __Pyx_INCREF(__pyx_v_result);
14688  __Pyx_GIVEREF(__pyx_v_result);
14689  __Pyx_GOTREF(__pyx_v_self->_size);
14690  __Pyx_DECREF(__pyx_v_self->_size);
14691  __pyx_v_self->_size = __pyx_v_result;
14692 
14693  /* "View.MemoryView":595
14694  * @property
14695  * def size(self):
14696  * if self._size is None: # <<<<<<<<<<<<<<
14697  * result = 1
14698  *
14699  */
14700  }
14701 
14702  /* "View.MemoryView":603
14703  * self._size = result
14704  *
14705  * return self._size # <<<<<<<<<<<<<<
14706  *
14707  * def __len__(self):
14708  */
14709  __Pyx_XDECREF(__pyx_r);
14710  __Pyx_INCREF(__pyx_v_self->_size);
14711  __pyx_r = __pyx_v_self->_size;
14712  goto __pyx_L0;
14713 
14714  /* "View.MemoryView":594
14715  *
14716  * @property
14717  * def size(self): # <<<<<<<<<<<<<<
14718  * if self._size is None:
14719  * result = 1
14720  */
14721 
14722  /* function exit code */
14723  __pyx_L1_error:;
14724  __Pyx_XDECREF(__pyx_t_6);
14725  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14726  __pyx_r = NULL;
14727  __pyx_L0:;
14728  __Pyx_XDECREF(__pyx_v_result);
14729  __Pyx_XDECREF(__pyx_v_length);
14730  __Pyx_XGIVEREF(__pyx_r);
14731  __Pyx_RefNannyFinishContext();
14732  return __pyx_r;
14733 }
14734 
14735 /* "View.MemoryView":605
14736  * return self._size
14737  *
14738  * def __len__(self): # <<<<<<<<<<<<<<
14739  * if self.view.ndim >= 1:
14740  * return self.view.shape[0]
14741  */
14742 
14743 /* Python wrapper */
14744 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
14745 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14746  Py_ssize_t __pyx_r;
14747  __Pyx_RefNannyDeclarations
14748  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
14749  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14750 
14751  /* function exit code */
14752  __Pyx_RefNannyFinishContext();
14753  return __pyx_r;
14754 }
14755 
14756 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
14757  Py_ssize_t __pyx_r;
14758  __Pyx_RefNannyDeclarations
14759  int __pyx_t_1;
14760  __Pyx_RefNannySetupContext("__len__", 0);
14761 
14762  /* "View.MemoryView":606
14763  *
14764  * def __len__(self):
14765  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14766  * return self.view.shape[0]
14767  *
14768  */
14769  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14770  if (__pyx_t_1) {
14771 
14772  /* "View.MemoryView":607
14773  * def __len__(self):
14774  * if self.view.ndim >= 1:
14775  * return self.view.shape[0] # <<<<<<<<<<<<<<
14776  *
14777  * return 0
14778  */
14779  __pyx_r = (__pyx_v_self->view.shape[0]);
14780  goto __pyx_L0;
14781 
14782  /* "View.MemoryView":606
14783  *
14784  * def __len__(self):
14785  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14786  * return self.view.shape[0]
14787  *
14788  */
14789  }
14790 
14791  /* "View.MemoryView":609
14792  * return self.view.shape[0]
14793  *
14794  * return 0 # <<<<<<<<<<<<<<
14795  *
14796  * def __repr__(self):
14797  */
14798  __pyx_r = 0;
14799  goto __pyx_L0;
14800 
14801  /* "View.MemoryView":605
14802  * return self._size
14803  *
14804  * def __len__(self): # <<<<<<<<<<<<<<
14805  * if self.view.ndim >= 1:
14806  * return self.view.shape[0]
14807  */
14808 
14809  /* function exit code */
14810  __pyx_L0:;
14811  __Pyx_RefNannyFinishContext();
14812  return __pyx_r;
14813 }
14814 
14815 /* "View.MemoryView":611
14816  * return 0
14817  *
14818  * def __repr__(self): # <<<<<<<<<<<<<<
14819  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14820  * id(self))
14821  */
14822 
14823 /* Python wrapper */
14824 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
14825 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14826  PyObject *__pyx_r = 0;
14827  __Pyx_RefNannyDeclarations
14828  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
14829  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14830 
14831  /* function exit code */
14832  __Pyx_RefNannyFinishContext();
14833  return __pyx_r;
14834 }
14835 
14836 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
14837  PyObject *__pyx_r = NULL;
14838  __Pyx_RefNannyDeclarations
14839  PyObject *__pyx_t_1 = NULL;
14840  PyObject *__pyx_t_2 = NULL;
14841  PyObject *__pyx_t_3 = NULL;
14842  __Pyx_RefNannySetupContext("__repr__", 0);
14843 
14844  /* "View.MemoryView":612
14845  *
14846  * def __repr__(self):
14847  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14848  * id(self))
14849  *
14850  */
14851  __Pyx_XDECREF(__pyx_r);
14852  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
14853  __Pyx_GOTREF(__pyx_t_1);
14854  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
14855  __Pyx_GOTREF(__pyx_t_2);
14856  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14857  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
14858  __Pyx_GOTREF(__pyx_t_1);
14859  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14860 
14861  /* "View.MemoryView":613
14862  * def __repr__(self):
14863  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14864  * id(self)) # <<<<<<<<<<<<<<
14865  *
14866  * def __str__(self):
14867  */
14868  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error)
14869  __Pyx_GOTREF(__pyx_t_2);
14870 
14871  /* "View.MemoryView":612
14872  *
14873  * def __repr__(self):
14874  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14875  * id(self))
14876  *
14877  */
14878  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error)
14879  __Pyx_GOTREF(__pyx_t_3);
14880  __Pyx_GIVEREF(__pyx_t_1);
14881  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14882  __Pyx_GIVEREF(__pyx_t_2);
14883  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14884  __pyx_t_1 = 0;
14885  __pyx_t_2 = 0;
14886  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
14887  __Pyx_GOTREF(__pyx_t_2);
14888  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14889  __pyx_r = __pyx_t_2;
14890  __pyx_t_2 = 0;
14891  goto __pyx_L0;
14892 
14893  /* "View.MemoryView":611
14894  * return 0
14895  *
14896  * def __repr__(self): # <<<<<<<<<<<<<<
14897  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14898  * id(self))
14899  */
14900 
14901  /* function exit code */
14902  __pyx_L1_error:;
14903  __Pyx_XDECREF(__pyx_t_1);
14904  __Pyx_XDECREF(__pyx_t_2);
14905  __Pyx_XDECREF(__pyx_t_3);
14906  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14907  __pyx_r = NULL;
14908  __pyx_L0:;
14909  __Pyx_XGIVEREF(__pyx_r);
14910  __Pyx_RefNannyFinishContext();
14911  return __pyx_r;
14912 }
14913 
14914 /* "View.MemoryView":615
14915  * id(self))
14916  *
14917  * def __str__(self): # <<<<<<<<<<<<<<
14918  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14919  *
14920  */
14921 
14922 /* Python wrapper */
14923 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14924 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14925  PyObject *__pyx_r = 0;
14926  __Pyx_RefNannyDeclarations
14927  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14928  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14929 
14930  /* function exit code */
14931  __Pyx_RefNannyFinishContext();
14932  return __pyx_r;
14933 }
14934 
14935 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14936  PyObject *__pyx_r = NULL;
14937  __Pyx_RefNannyDeclarations
14938  PyObject *__pyx_t_1 = NULL;
14939  PyObject *__pyx_t_2 = NULL;
14940  __Pyx_RefNannySetupContext("__str__", 0);
14941 
14942  /* "View.MemoryView":616
14943  *
14944  * def __str__(self):
14945  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14946  *
14947  *
14948  */
14949  __Pyx_XDECREF(__pyx_r);
14950  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14951  __Pyx_GOTREF(__pyx_t_1);
14952  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
14953  __Pyx_GOTREF(__pyx_t_2);
14954  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14955  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14956  __Pyx_GOTREF(__pyx_t_1);
14957  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14958  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
14959  __Pyx_GOTREF(__pyx_t_2);
14960  __Pyx_GIVEREF(__pyx_t_1);
14961  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14962  __pyx_t_1 = 0;
14963  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14964  __Pyx_GOTREF(__pyx_t_1);
14965  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14966  __pyx_r = __pyx_t_1;
14967  __pyx_t_1 = 0;
14968  goto __pyx_L0;
14969 
14970  /* "View.MemoryView":615
14971  * id(self))
14972  *
14973  * def __str__(self): # <<<<<<<<<<<<<<
14974  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14975  *
14976  */
14977 
14978  /* function exit code */
14979  __pyx_L1_error:;
14980  __Pyx_XDECREF(__pyx_t_1);
14981  __Pyx_XDECREF(__pyx_t_2);
14982  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14983  __pyx_r = NULL;
14984  __pyx_L0:;
14985  __Pyx_XGIVEREF(__pyx_r);
14986  __Pyx_RefNannyFinishContext();
14987  return __pyx_r;
14988 }
14989 
14990 /* "View.MemoryView":619
14991  *
14992  *
14993  * def is_c_contig(self): # <<<<<<<<<<<<<<
14994  * cdef __Pyx_memviewslice *mslice
14995  * cdef __Pyx_memviewslice tmp
14996  */
14997 
14998 /* Python wrapper */
14999 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15000 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15001  PyObject *__pyx_r = 0;
15002  __Pyx_RefNannyDeclarations
15003  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
15004  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
15005 
15006  /* function exit code */
15007  __Pyx_RefNannyFinishContext();
15008  return __pyx_r;
15009 }
15010 
15011 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
15012  __Pyx_memviewslice *__pyx_v_mslice;
15013  __Pyx_memviewslice __pyx_v_tmp;
15014  PyObject *__pyx_r = NULL;
15015  __Pyx_RefNannyDeclarations
15016  __Pyx_memviewslice *__pyx_t_1;
15017  PyObject *__pyx_t_2 = NULL;
15018  __Pyx_RefNannySetupContext("is_c_contig", 0);
15019 
15020  /* "View.MemoryView":622
15021  * cdef __Pyx_memviewslice *mslice
15022  * cdef __Pyx_memviewslice tmp
15023  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
15024  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
15025  *
15026  */
15027  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 622, __pyx_L1_error)
15028  __pyx_v_mslice = __pyx_t_1;
15029 
15030  /* "View.MemoryView":623
15031  * cdef __Pyx_memviewslice tmp
15032  * mslice = get_slice_from_memview(self, &tmp)
15033  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
15034  *
15035  * def is_f_contig(self):
15036  */
15037  __Pyx_XDECREF(__pyx_r);
15038  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 623, __pyx_L1_error)
15039  __Pyx_GOTREF(__pyx_t_2);
15040  __pyx_r = __pyx_t_2;
15041  __pyx_t_2 = 0;
15042  goto __pyx_L0;
15043 
15044  /* "View.MemoryView":619
15045  *
15046  *
15047  * def is_c_contig(self): # <<<<<<<<<<<<<<
15048  * cdef __Pyx_memviewslice *mslice
15049  * cdef __Pyx_memviewslice tmp
15050  */
15051 
15052  /* function exit code */
15053  __pyx_L1_error:;
15054  __Pyx_XDECREF(__pyx_t_2);
15055  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15056  __pyx_r = NULL;
15057  __pyx_L0:;
15058  __Pyx_XGIVEREF(__pyx_r);
15059  __Pyx_RefNannyFinishContext();
15060  return __pyx_r;
15061 }
15062 
15063 /* "View.MemoryView":625
15064  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
15065  *
15066  * def is_f_contig(self): # <<<<<<<<<<<<<<
15067  * cdef __Pyx_memviewslice *mslice
15068  * cdef __Pyx_memviewslice tmp
15069  */
15070 
15071 /* Python wrapper */
15072 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15073 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15074  PyObject *__pyx_r = 0;
15075  __Pyx_RefNannyDeclarations
15076  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
15077  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
15078 
15079  /* function exit code */
15080  __Pyx_RefNannyFinishContext();
15081  return __pyx_r;
15082 }
15083 
15084 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
15085  __Pyx_memviewslice *__pyx_v_mslice;
15086  __Pyx_memviewslice __pyx_v_tmp;
15087  PyObject *__pyx_r = NULL;
15088  __Pyx_RefNannyDeclarations
15089  __Pyx_memviewslice *__pyx_t_1;
15090  PyObject *__pyx_t_2 = NULL;
15091  __Pyx_RefNannySetupContext("is_f_contig", 0);
15092 
15093  /* "View.MemoryView":628
15094  * cdef __Pyx_memviewslice *mslice
15095  * cdef __Pyx_memviewslice tmp
15096  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
15097  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15098  *
15099  */
15100  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 628, __pyx_L1_error)
15101  __pyx_v_mslice = __pyx_t_1;
15102 
15103  /* "View.MemoryView":629
15104  * cdef __Pyx_memviewslice tmp
15105  * mslice = get_slice_from_memview(self, &tmp)
15106  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
15107  *
15108  * def copy(self):
15109  */
15110  __Pyx_XDECREF(__pyx_r);
15111  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 629, __pyx_L1_error)
15112  __Pyx_GOTREF(__pyx_t_2);
15113  __pyx_r = __pyx_t_2;
15114  __pyx_t_2 = 0;
15115  goto __pyx_L0;
15116 
15117  /* "View.MemoryView":625
15118  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
15119  *
15120  * def is_f_contig(self): # <<<<<<<<<<<<<<
15121  * cdef __Pyx_memviewslice *mslice
15122  * cdef __Pyx_memviewslice tmp
15123  */
15124 
15125  /* function exit code */
15126  __pyx_L1_error:;
15127  __Pyx_XDECREF(__pyx_t_2);
15128  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15129  __pyx_r = NULL;
15130  __pyx_L0:;
15131  __Pyx_XGIVEREF(__pyx_r);
15132  __Pyx_RefNannyFinishContext();
15133  return __pyx_r;
15134 }
15135 
15136 /* "View.MemoryView":631
15137  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15138  *
15139  * def copy(self): # <<<<<<<<<<<<<<
15140  * cdef __Pyx_memviewslice mslice
15141  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15142  */
15143 
15144 /* Python wrapper */
15145 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15146 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15147  PyObject *__pyx_r = 0;
15148  __Pyx_RefNannyDeclarations
15149  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
15150  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
15151 
15152  /* function exit code */
15153  __Pyx_RefNannyFinishContext();
15154  return __pyx_r;
15155 }
15156 
15157 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
15158  __Pyx_memviewslice __pyx_v_mslice;
15159  int __pyx_v_flags;
15160  PyObject *__pyx_r = NULL;
15161  __Pyx_RefNannyDeclarations
15162  __Pyx_memviewslice __pyx_t_1;
15163  PyObject *__pyx_t_2 = NULL;
15164  __Pyx_RefNannySetupContext("copy", 0);
15165 
15166  /* "View.MemoryView":633
15167  * def copy(self):
15168  * cdef __Pyx_memviewslice mslice
15169  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
15170  *
15171  * slice_copy(self, &mslice)
15172  */
15173  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
15174 
15175  /* "View.MemoryView":635
15176  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15177  *
15178  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
15179  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
15180  * self.view.itemsize,
15181  */
15182  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
15183 
15184  /* "View.MemoryView":636
15185  *
15186  * slice_copy(self, &mslice)
15187  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
15188  * self.view.itemsize,
15189  * flags|PyBUF_C_CONTIGUOUS,
15190  */
15191  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 636, __pyx_L1_error)
15192  __pyx_v_mslice = __pyx_t_1;
15193 
15194  /* "View.MemoryView":641
15195  * self.dtype_is_object)
15196  *
15197  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
15198  *
15199  * def copy_fortran(self):
15200  */
15201  __Pyx_XDECREF(__pyx_r);
15202  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 641, __pyx_L1_error)
15203  __Pyx_GOTREF(__pyx_t_2);
15204  __pyx_r = __pyx_t_2;
15205  __pyx_t_2 = 0;
15206  goto __pyx_L0;
15207 
15208  /* "View.MemoryView":631
15209  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15210  *
15211  * def copy(self): # <<<<<<<<<<<<<<
15212  * cdef __Pyx_memviewslice mslice
15213  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15214  */
15215 
15216  /* function exit code */
15217  __pyx_L1_error:;
15218  __Pyx_XDECREF(__pyx_t_2);
15219  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15220  __pyx_r = NULL;
15221  __pyx_L0:;
15222  __Pyx_XGIVEREF(__pyx_r);
15223  __Pyx_RefNannyFinishContext();
15224  return __pyx_r;
15225 }
15226 
15227 /* "View.MemoryView":643
15228  * return memoryview_copy_from_slice(self, &mslice)
15229  *
15230  * def copy_fortran(self): # <<<<<<<<<<<<<<
15231  * cdef __Pyx_memviewslice src, dst
15232  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15233  */
15234 
15235 /* Python wrapper */
15236 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15237 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15238  PyObject *__pyx_r = 0;
15239  __Pyx_RefNannyDeclarations
15240  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
15241  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
15242 
15243  /* function exit code */
15244  __Pyx_RefNannyFinishContext();
15245  return __pyx_r;
15246 }
15247 
15248 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
15249  __Pyx_memviewslice __pyx_v_src;
15250  __Pyx_memviewslice __pyx_v_dst;
15251  int __pyx_v_flags;
15252  PyObject *__pyx_r = NULL;
15253  __Pyx_RefNannyDeclarations
15254  __Pyx_memviewslice __pyx_t_1;
15255  PyObject *__pyx_t_2 = NULL;
15256  __Pyx_RefNannySetupContext("copy_fortran", 0);
15257 
15258  /* "View.MemoryView":645
15259  * def copy_fortran(self):
15260  * cdef __Pyx_memviewslice src, dst
15261  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
15262  *
15263  * slice_copy(self, &src)
15264  */
15265  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
15266 
15267  /* "View.MemoryView":647
15268  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15269  *
15270  * slice_copy(self, &src) # <<<<<<<<<<<<<<
15271  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
15272  * self.view.itemsize,
15273  */
15274  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
15275 
15276  /* "View.MemoryView":648
15277  *
15278  * slice_copy(self, &src)
15279  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
15280  * self.view.itemsize,
15281  * flags|PyBUF_F_CONTIGUOUS,
15282  */
15283  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 648, __pyx_L1_error)
15284  __pyx_v_dst = __pyx_t_1;
15285 
15286  /* "View.MemoryView":653
15287  * self.dtype_is_object)
15288  *
15289  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
15290  *
15291  *
15292  */
15293  __Pyx_XDECREF(__pyx_r);
15294  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error)
15295  __Pyx_GOTREF(__pyx_t_2);
15296  __pyx_r = __pyx_t_2;
15297  __pyx_t_2 = 0;
15298  goto __pyx_L0;
15299 
15300  /* "View.MemoryView":643
15301  * return memoryview_copy_from_slice(self, &mslice)
15302  *
15303  * def copy_fortran(self): # <<<<<<<<<<<<<<
15304  * cdef __Pyx_memviewslice src, dst
15305  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15306  */
15307 
15308  /* function exit code */
15309  __pyx_L1_error:;
15310  __Pyx_XDECREF(__pyx_t_2);
15311  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
15312  __pyx_r = NULL;
15313  __pyx_L0:;
15314  __Pyx_XGIVEREF(__pyx_r);
15315  __Pyx_RefNannyFinishContext();
15316  return __pyx_r;
15317 }
15318 
15319 /* "(tree fragment)":1
15320  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15321  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15322  * def __setstate_cython__(self, __pyx_state):
15323  */
15324 
15325 /* Python wrapper */
15326 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15327 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15328  PyObject *__pyx_r = 0;
15329  __Pyx_RefNannyDeclarations
15330  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15331  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15332 
15333  /* function exit code */
15334  __Pyx_RefNannyFinishContext();
15335  return __pyx_r;
15336 }
15337 
15338 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
15339  PyObject *__pyx_r = NULL;
15340  __Pyx_RefNannyDeclarations
15341  PyObject *__pyx_t_1 = NULL;
15342  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15343 
15344  /* "(tree fragment)":2
15345  * def __reduce_cython__(self):
15346  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15347  * def __setstate_cython__(self, __pyx_state):
15348  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15349  */
15350  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
15351  __Pyx_GOTREF(__pyx_t_1);
15352  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15353  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15354  __PYX_ERR(2, 2, __pyx_L1_error)
15355 
15356  /* "(tree fragment)":1
15357  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15358  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15359  * def __setstate_cython__(self, __pyx_state):
15360  */
15361 
15362  /* function exit code */
15363  __pyx_L1_error:;
15364  __Pyx_XDECREF(__pyx_t_1);
15365  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15366  __pyx_r = NULL;
15367  __Pyx_XGIVEREF(__pyx_r);
15368  __Pyx_RefNannyFinishContext();
15369  return __pyx_r;
15370 }
15371 
15372 /* "(tree fragment)":3
15373  * def __reduce_cython__(self):
15374  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15375  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15376  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15377  */
15378 
15379 /* Python wrapper */
15380 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
15381 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15382  PyObject *__pyx_r = 0;
15383  __Pyx_RefNannyDeclarations
15384  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15385  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15386 
15387  /* function exit code */
15388  __Pyx_RefNannyFinishContext();
15389  return __pyx_r;
15390 }
15391 
15392 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15393  PyObject *__pyx_r = NULL;
15394  __Pyx_RefNannyDeclarations
15395  PyObject *__pyx_t_1 = NULL;
15396  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15397 
15398  /* "(tree fragment)":4
15399  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15400  * def __setstate_cython__(self, __pyx_state):
15401  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15402  */
15403  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
15404  __Pyx_GOTREF(__pyx_t_1);
15405  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15406  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15407  __PYX_ERR(2, 4, __pyx_L1_error)
15408 
15409  /* "(tree fragment)":3
15410  * def __reduce_cython__(self):
15411  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15412  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15413  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15414  */
15415 
15416  /* function exit code */
15417  __pyx_L1_error:;
15418  __Pyx_XDECREF(__pyx_t_1);
15419  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15420  __pyx_r = NULL;
15421  __Pyx_XGIVEREF(__pyx_r);
15422  __Pyx_RefNannyFinishContext();
15423  return __pyx_r;
15424 }
15425 
15426 /* "View.MemoryView":657
15427  *
15428  * @cname('__pyx_memoryview_new')
15429  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15430  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15431  * result.typeinfo = typeinfo
15432  */
15433 
15434 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
15435  struct __pyx_memoryview_obj *__pyx_v_result = 0;
15436  PyObject *__pyx_r = NULL;
15437  __Pyx_RefNannyDeclarations
15438  PyObject *__pyx_t_1 = NULL;
15439  PyObject *__pyx_t_2 = NULL;
15440  PyObject *__pyx_t_3 = NULL;
15441  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
15442 
15443  /* "View.MemoryView":658
15444  * @cname('__pyx_memoryview_new')
15445  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15446  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
15447  * result.typeinfo = typeinfo
15448  * return result
15449  */
15450  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __pyx_L1_error)
15451  __Pyx_GOTREF(__pyx_t_1);
15452  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
15453  __Pyx_GOTREF(__pyx_t_2);
15454  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error)
15455  __Pyx_GOTREF(__pyx_t_3);
15456  __Pyx_INCREF(__pyx_v_o);
15457  __Pyx_GIVEREF(__pyx_v_o);
15458  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
15459  __Pyx_GIVEREF(__pyx_t_1);
15460  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
15461  __Pyx_GIVEREF(__pyx_t_2);
15462  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15463  __pyx_t_1 = 0;
15464  __pyx_t_2 = 0;
15465  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
15466  __Pyx_GOTREF(__pyx_t_2);
15467  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15468  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
15469  __pyx_t_2 = 0;
15470 
15471  /* "View.MemoryView":659
15472  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15473  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15474  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
15475  * return result
15476  *
15477  */
15478  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15479 
15480  /* "View.MemoryView":660
15481  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15482  * result.typeinfo = typeinfo
15483  * return result # <<<<<<<<<<<<<<
15484  *
15485  * @cname('__pyx_memoryview_check')
15486  */
15487  __Pyx_XDECREF(__pyx_r);
15488  __Pyx_INCREF(((PyObject *)__pyx_v_result));
15489  __pyx_r = ((PyObject *)__pyx_v_result);
15490  goto __pyx_L0;
15491 
15492  /* "View.MemoryView":657
15493  *
15494  * @cname('__pyx_memoryview_new')
15495  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15496  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15497  * result.typeinfo = typeinfo
15498  */
15499 
15500  /* function exit code */
15501  __pyx_L1_error:;
15502  __Pyx_XDECREF(__pyx_t_1);
15503  __Pyx_XDECREF(__pyx_t_2);
15504  __Pyx_XDECREF(__pyx_t_3);
15505  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15506  __pyx_r = 0;
15507  __pyx_L0:;
15508  __Pyx_XDECREF((PyObject *)__pyx_v_result);
15509  __Pyx_XGIVEREF(__pyx_r);
15510  __Pyx_RefNannyFinishContext();
15511  return __pyx_r;
15512 }
15513 
15514 /* "View.MemoryView":663
15515  *
15516  * @cname('__pyx_memoryview_check')
15517  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15518  * return isinstance(o, memoryview)
15519  *
15520  */
15521 
15522 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15523  int __pyx_r;
15524  __Pyx_RefNannyDeclarations
15525  int __pyx_t_1;
15526  __Pyx_RefNannySetupContext("memoryview_check", 0);
15527 
15528  /* "View.MemoryView":664
15529  * @cname('__pyx_memoryview_check')
15530  * cdef inline bint memoryview_check(object o):
15531  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
15532  *
15533  * cdef tuple _unellipsify(object index, int ndim):
15534  */
15535  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15536  __pyx_r = __pyx_t_1;
15537  goto __pyx_L0;
15538 
15539  /* "View.MemoryView":663
15540  *
15541  * @cname('__pyx_memoryview_check')
15542  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15543  * return isinstance(o, memoryview)
15544  *
15545  */
15546 
15547  /* function exit code */
15548  __pyx_L0:;
15549  __Pyx_RefNannyFinishContext();
15550  return __pyx_r;
15551 }
15552 
15553 /* "View.MemoryView":666
15554  * return isinstance(o, memoryview)
15555  *
15556  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15557  * """
15558  * Replace all ellipses with full slices and fill incomplete indices with
15559  */
15560 
15561 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
15562  PyObject *__pyx_v_tup = NULL;
15563  PyObject *__pyx_v_result = NULL;
15564  int __pyx_v_have_slices;
15565  int __pyx_v_seen_ellipsis;
15566  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15567  PyObject *__pyx_v_item = NULL;
15568  Py_ssize_t __pyx_v_nslices;
15569  PyObject *__pyx_r = NULL;
15570  __Pyx_RefNannyDeclarations
15571  int __pyx_t_1;
15572  int __pyx_t_2;
15573  PyObject *__pyx_t_3 = NULL;
15574  PyObject *__pyx_t_4 = NULL;
15575  Py_ssize_t __pyx_t_5;
15576  PyObject *(*__pyx_t_6)(PyObject *);
15577  PyObject *__pyx_t_7 = NULL;
15578  Py_ssize_t __pyx_t_8;
15579  int __pyx_t_9;
15580  int __pyx_t_10;
15581  PyObject *__pyx_t_11 = NULL;
15582  __Pyx_RefNannySetupContext("_unellipsify", 0);
15583 
15584  /* "View.MemoryView":671
15585  * full slices.
15586  * """
15587  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15588  * tup = (index,)
15589  * else:
15590  */
15591  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15592  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15593  if (__pyx_t_2) {
15594 
15595  /* "View.MemoryView":672
15596  * """
15597  * if not isinstance(index, tuple):
15598  * tup = (index,) # <<<<<<<<<<<<<<
15599  * else:
15600  * tup = index
15601  */
15602  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error)
15603  __Pyx_GOTREF(__pyx_t_3);
15604  __Pyx_INCREF(__pyx_v_index);
15605  __Pyx_GIVEREF(__pyx_v_index);
15606  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15607  __pyx_v_tup = __pyx_t_3;
15608  __pyx_t_3 = 0;
15609 
15610  /* "View.MemoryView":671
15611  * full slices.
15612  * """
15613  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15614  * tup = (index,)
15615  * else:
15616  */
15617  goto __pyx_L3;
15618  }
15619 
15620  /* "View.MemoryView":674
15621  * tup = (index,)
15622  * else:
15623  * tup = index # <<<<<<<<<<<<<<
15624  *
15625  * result = []
15626  */
15627  /*else*/ {
15628  __Pyx_INCREF(__pyx_v_index);
15629  __pyx_v_tup = __pyx_v_index;
15630  }
15631  __pyx_L3:;
15632 
15633  /* "View.MemoryView":676
15634  * tup = index
15635  *
15636  * result = [] # <<<<<<<<<<<<<<
15637  * have_slices = False
15638  * seen_ellipsis = False
15639  */
15640  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 676, __pyx_L1_error)
15641  __Pyx_GOTREF(__pyx_t_3);
15642  __pyx_v_result = ((PyObject*)__pyx_t_3);
15643  __pyx_t_3 = 0;
15644 
15645  /* "View.MemoryView":677
15646  *
15647  * result = []
15648  * have_slices = False # <<<<<<<<<<<<<<
15649  * seen_ellipsis = False
15650  * for idx, item in enumerate(tup):
15651  */
15652  __pyx_v_have_slices = 0;
15653 
15654  /* "View.MemoryView":678
15655  * result = []
15656  * have_slices = False
15657  * seen_ellipsis = False # <<<<<<<<<<<<<<
15658  * for idx, item in enumerate(tup):
15659  * if item is Ellipsis:
15660  */
15661  __pyx_v_seen_ellipsis = 0;
15662 
15663  /* "View.MemoryView":679
15664  * have_slices = False
15665  * seen_ellipsis = False
15666  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15667  * if item is Ellipsis:
15668  * if not seen_ellipsis:
15669  */
15670  __Pyx_INCREF(__pyx_int_0);
15671  __pyx_t_3 = __pyx_int_0;
15672  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15673  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15674  __pyx_t_6 = NULL;
15675  } else {
15676  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 679, __pyx_L1_error)
15677  __Pyx_GOTREF(__pyx_t_4);
15678  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 679, __pyx_L1_error)
15679  }
15680  for (;;) {
15681  if (likely(!__pyx_t_6)) {
15682  if (likely(PyList_CheckExact(__pyx_t_4))) {
15683  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
15684  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15685  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
15686  #else
15687  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15688  __Pyx_GOTREF(__pyx_t_7);
15689  #endif
15690  } else {
15691  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
15692  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15693  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
15694  #else
15695  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15696  __Pyx_GOTREF(__pyx_t_7);
15697  #endif
15698  }
15699  } else {
15700  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15701  if (unlikely(!__pyx_t_7)) {
15702  PyObject* exc_type = PyErr_Occurred();
15703  if (exc_type) {
15704  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15705  else __PYX_ERR(2, 679, __pyx_L1_error)
15706  }
15707  break;
15708  }
15709  __Pyx_GOTREF(__pyx_t_7);
15710  }
15711  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15712  __pyx_t_7 = 0;
15713  __Pyx_INCREF(__pyx_t_3);
15714  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15715  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15716  __Pyx_GOTREF(__pyx_t_7);
15717  __Pyx_DECREF(__pyx_t_3);
15718  __pyx_t_3 = __pyx_t_7;
15719  __pyx_t_7 = 0;
15720 
15721  /* "View.MemoryView":680
15722  * seen_ellipsis = False
15723  * for idx, item in enumerate(tup):
15724  * if item is Ellipsis: # <<<<<<<<<<<<<<
15725  * if not seen_ellipsis:
15726  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15727  */
15728  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15729  __pyx_t_1 = (__pyx_t_2 != 0);
15730  if (__pyx_t_1) {
15731 
15732  /* "View.MemoryView":681
15733  * for idx, item in enumerate(tup):
15734  * if item is Ellipsis:
15735  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15736  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15737  * seen_ellipsis = True
15738  */
15739  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15740  if (__pyx_t_1) {
15741 
15742  /* "View.MemoryView":682
15743  * if item is Ellipsis:
15744  * if not seen_ellipsis:
15745  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
15746  * seen_ellipsis = True
15747  * else:
15748  */
15749  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
15750  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 682, __pyx_L1_error)
15751  __Pyx_GOTREF(__pyx_t_7);
15752  { Py_ssize_t __pyx_temp;
15753  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15754  __Pyx_INCREF(__pyx_slice__22);
15755  __Pyx_GIVEREF(__pyx_slice__22);
15756  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__22);
15757  }
15758  }
15759  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
15760  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15761 
15762  /* "View.MemoryView":683
15763  * if not seen_ellipsis:
15764  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15765  * seen_ellipsis = True # <<<<<<<<<<<<<<
15766  * else:
15767  * result.append(slice(None))
15768  */
15769  __pyx_v_seen_ellipsis = 1;
15770 
15771  /* "View.MemoryView":681
15772  * for idx, item in enumerate(tup):
15773  * if item is Ellipsis:
15774  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15775  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15776  * seen_ellipsis = True
15777  */
15778  goto __pyx_L7;
15779  }
15780 
15781  /* "View.MemoryView":685
15782  * seen_ellipsis = True
15783  * else:
15784  * result.append(slice(None)) # <<<<<<<<<<<<<<
15785  * have_slices = True
15786  * else:
15787  */
15788  /*else*/ {
15789  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__22); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 685, __pyx_L1_error)
15790  }
15791  __pyx_L7:;
15792 
15793  /* "View.MemoryView":686
15794  * else:
15795  * result.append(slice(None))
15796  * have_slices = True # <<<<<<<<<<<<<<
15797  * else:
15798  * if not isinstance(item, slice) and not PyIndex_Check(item):
15799  */
15800  __pyx_v_have_slices = 1;
15801 
15802  /* "View.MemoryView":680
15803  * seen_ellipsis = False
15804  * for idx, item in enumerate(tup):
15805  * if item is Ellipsis: # <<<<<<<<<<<<<<
15806  * if not seen_ellipsis:
15807  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15808  */
15809  goto __pyx_L6;
15810  }
15811 
15812  /* "View.MemoryView":688
15813  * have_slices = True
15814  * else:
15815  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15816  * raise TypeError("Cannot index with type '%s'" % type(item))
15817  *
15818  */
15819  /*else*/ {
15820  __pyx_t_2 = PySlice_Check(__pyx_v_item);
15821  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15822  if (__pyx_t_10) {
15823  } else {
15824  __pyx_t_1 = __pyx_t_10;
15825  goto __pyx_L9_bool_binop_done;
15826  }
15827  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15828  __pyx_t_1 = __pyx_t_10;
15829  __pyx_L9_bool_binop_done:;
15830  if (unlikely(__pyx_t_1)) {
15831 
15832  /* "View.MemoryView":689
15833  * else:
15834  * if not isinstance(item, slice) and not PyIndex_Check(item):
15835  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
15836  *
15837  * have_slices = have_slices or isinstance(item, slice)
15838  */
15839  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error)
15840  __Pyx_GOTREF(__pyx_t_7);
15841  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 689, __pyx_L1_error)
15842  __Pyx_GOTREF(__pyx_t_11);
15843  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15844  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15845  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15846  __PYX_ERR(2, 689, __pyx_L1_error)
15847 
15848  /* "View.MemoryView":688
15849  * have_slices = True
15850  * else:
15851  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15852  * raise TypeError("Cannot index with type '%s'" % type(item))
15853  *
15854  */
15855  }
15856 
15857  /* "View.MemoryView":691
15858  * raise TypeError("Cannot index with type '%s'" % type(item))
15859  *
15860  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
15861  * result.append(item)
15862  *
15863  */
15864  __pyx_t_10 = (__pyx_v_have_slices != 0);
15865  if (!__pyx_t_10) {
15866  } else {
15867  __pyx_t_1 = __pyx_t_10;
15868  goto __pyx_L11_bool_binop_done;
15869  }
15870  __pyx_t_10 = PySlice_Check(__pyx_v_item);
15871  __pyx_t_2 = (__pyx_t_10 != 0);
15872  __pyx_t_1 = __pyx_t_2;
15873  __pyx_L11_bool_binop_done:;
15874  __pyx_v_have_slices = __pyx_t_1;
15875 
15876  /* "View.MemoryView":692
15877  *
15878  * have_slices = have_slices or isinstance(item, slice)
15879  * result.append(item) # <<<<<<<<<<<<<<
15880  *
15881  * nslices = ndim - len(result)
15882  */
15883  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error)
15884  }
15885  __pyx_L6:;
15886 
15887  /* "View.MemoryView":679
15888  * have_slices = False
15889  * seen_ellipsis = False
15890  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15891  * if item is Ellipsis:
15892  * if not seen_ellipsis:
15893  */
15894  }
15895  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15896  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15897 
15898  /* "View.MemoryView":694
15899  * result.append(item)
15900  *
15901  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15902  * if nslices:
15903  * result.extend([slice(None)] * nslices)
15904  */
15905  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 694, __pyx_L1_error)
15906  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15907 
15908  /* "View.MemoryView":695
15909  *
15910  * nslices = ndim - len(result)
15911  * if nslices: # <<<<<<<<<<<<<<
15912  * result.extend([slice(None)] * nslices)
15913  *
15914  */
15915  __pyx_t_1 = (__pyx_v_nslices != 0);
15916  if (__pyx_t_1) {
15917 
15918  /* "View.MemoryView":696
15919  * nslices = ndim - len(result)
15920  * if nslices:
15921  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15922  *
15923  * return have_slices or nslices, tuple(result)
15924  */
15925  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 696, __pyx_L1_error)
15926  __Pyx_GOTREF(__pyx_t_3);
15927  { Py_ssize_t __pyx_temp;
15928  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15929  __Pyx_INCREF(__pyx_slice__22);
15930  __Pyx_GIVEREF(__pyx_slice__22);
15931  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__22);
15932  }
15933  }
15934  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 696, __pyx_L1_error)
15935  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15936 
15937  /* "View.MemoryView":695
15938  *
15939  * nslices = ndim - len(result)
15940  * if nslices: # <<<<<<<<<<<<<<
15941  * result.extend([slice(None)] * nslices)
15942  *
15943  */
15944  }
15945 
15946  /* "View.MemoryView":698
15947  * result.extend([slice(None)] * nslices)
15948  *
15949  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15950  *
15951  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15952  */
15953  __Pyx_XDECREF(__pyx_r);
15954  if (!__pyx_v_have_slices) {
15955  } else {
15956  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15957  __Pyx_GOTREF(__pyx_t_4);
15958  __pyx_t_3 = __pyx_t_4;
15959  __pyx_t_4 = 0;
15960  goto __pyx_L14_bool_binop_done;
15961  }
15962  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15963  __Pyx_GOTREF(__pyx_t_4);
15964  __pyx_t_3 = __pyx_t_4;
15965  __pyx_t_4 = 0;
15966  __pyx_L14_bool_binop_done:;
15967  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15968  __Pyx_GOTREF(__pyx_t_4);
15969  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 698, __pyx_L1_error)
15970  __Pyx_GOTREF(__pyx_t_11);
15971  __Pyx_GIVEREF(__pyx_t_3);
15972  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15973  __Pyx_GIVEREF(__pyx_t_4);
15974  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15975  __pyx_t_3 = 0;
15976  __pyx_t_4 = 0;
15977  __pyx_r = ((PyObject*)__pyx_t_11);
15978  __pyx_t_11 = 0;
15979  goto __pyx_L0;
15980 
15981  /* "View.MemoryView":666
15982  * return isinstance(o, memoryview)
15983  *
15984  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15985  * """
15986  * Replace all ellipses with full slices and fill incomplete indices with
15987  */
15988 
15989  /* function exit code */
15990  __pyx_L1_error:;
15991  __Pyx_XDECREF(__pyx_t_3);
15992  __Pyx_XDECREF(__pyx_t_4);
15993  __Pyx_XDECREF(__pyx_t_7);
15994  __Pyx_XDECREF(__pyx_t_11);
15995  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15996  __pyx_r = 0;
15997  __pyx_L0:;
15998  __Pyx_XDECREF(__pyx_v_tup);
15999  __Pyx_XDECREF(__pyx_v_result);
16000  __Pyx_XDECREF(__pyx_v_idx);
16001  __Pyx_XDECREF(__pyx_v_item);
16002  __Pyx_XGIVEREF(__pyx_r);
16003  __Pyx_RefNannyFinishContext();
16004  return __pyx_r;
16005 }
16006 
16007 /* "View.MemoryView":700
16008  * return have_slices or nslices, tuple(result)
16009  *
16010  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
16011  * for suboffset in suboffsets[:ndim]:
16012  * if suboffset >= 0:
16013  */
16014 
16015 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
16016  Py_ssize_t __pyx_v_suboffset;
16017  PyObject *__pyx_r = NULL;
16018  __Pyx_RefNannyDeclarations
16019  Py_ssize_t *__pyx_t_1;
16020  Py_ssize_t *__pyx_t_2;
16021  Py_ssize_t *__pyx_t_3;
16022  int __pyx_t_4;
16023  PyObject *__pyx_t_5 = NULL;
16024  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
16025 
16026  /* "View.MemoryView":701
16027  *
16028  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16029  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
16030  * if suboffset >= 0:
16031  * raise ValueError("Indirect dimensions not supported")
16032  */
16033  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
16034  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16035  __pyx_t_1 = __pyx_t_3;
16036  __pyx_v_suboffset = (__pyx_t_1[0]);
16037 
16038  /* "View.MemoryView":702
16039  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16040  * for suboffset in suboffsets[:ndim]:
16041  * if suboffset >= 0: # <<<<<<<<<<<<<<
16042  * raise ValueError("Indirect dimensions not supported")
16043  *
16044  */
16045  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
16046  if (unlikely(__pyx_t_4)) {
16047 
16048  /* "View.MemoryView":703
16049  * for suboffset in suboffsets[:ndim]:
16050  * if suboffset >= 0:
16051  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
16052  *
16053  *
16054  */
16055  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error)
16056  __Pyx_GOTREF(__pyx_t_5);
16057  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
16058  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16059  __PYX_ERR(2, 703, __pyx_L1_error)
16060 
16061  /* "View.MemoryView":702
16062  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16063  * for suboffset in suboffsets[:ndim]:
16064  * if suboffset >= 0: # <<<<<<<<<<<<<<
16065  * raise ValueError("Indirect dimensions not supported")
16066  *
16067  */
16068  }
16069  }
16070 
16071  /* "View.MemoryView":700
16072  * return have_slices or nslices, tuple(result)
16073  *
16074  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
16075  * for suboffset in suboffsets[:ndim]:
16076  * if suboffset >= 0:
16077  */
16078 
16079  /* function exit code */
16080  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16081  goto __pyx_L0;
16082  __pyx_L1_error:;
16083  __Pyx_XDECREF(__pyx_t_5);
16084  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
16085  __pyx_r = 0;
16086  __pyx_L0:;
16087  __Pyx_XGIVEREF(__pyx_r);
16088  __Pyx_RefNannyFinishContext();
16089  return __pyx_r;
16090 }
16091 
16092 /* "View.MemoryView":710
16093  *
16094  * @cname('__pyx_memview_slice')
16095  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16096  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16097  * cdef bint negative_step
16098  */
16099 
16100 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
16101  int __pyx_v_new_ndim;
16102  int __pyx_v_suboffset_dim;
16103  int __pyx_v_dim;
16104  __Pyx_memviewslice __pyx_v_src;
16105  __Pyx_memviewslice __pyx_v_dst;
16106  __Pyx_memviewslice *__pyx_v_p_src;
16107  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
16108  __Pyx_memviewslice *__pyx_v_p_dst;
16109  int *__pyx_v_p_suboffset_dim;
16110  Py_ssize_t __pyx_v_start;
16111  Py_ssize_t __pyx_v_stop;
16112  Py_ssize_t __pyx_v_step;
16113  int __pyx_v_have_start;
16114  int __pyx_v_have_stop;
16115  int __pyx_v_have_step;
16116  PyObject *__pyx_v_index = NULL;
16117  struct __pyx_memoryview_obj *__pyx_r = NULL;
16118  __Pyx_RefNannyDeclarations
16119  int __pyx_t_1;
16120  int __pyx_t_2;
16121  PyObject *__pyx_t_3 = NULL;
16122  struct __pyx_memoryview_obj *__pyx_t_4;
16123  char *__pyx_t_5;
16124  int __pyx_t_6;
16125  Py_ssize_t __pyx_t_7;
16126  PyObject *(*__pyx_t_8)(PyObject *);
16127  PyObject *__pyx_t_9 = NULL;
16128  Py_ssize_t __pyx_t_10;
16129  int __pyx_t_11;
16130  Py_ssize_t __pyx_t_12;
16131  __Pyx_RefNannySetupContext("memview_slice", 0);
16132 
16133  /* "View.MemoryView":711
16134  * @cname('__pyx_memview_slice')
16135  * cdef memoryview memview_slice(memoryview memview, object indices):
16136  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
16137  * cdef bint negative_step
16138  * cdef __Pyx_memviewslice src, dst
16139  */
16140  __pyx_v_new_ndim = 0;
16141  __pyx_v_suboffset_dim = -1;
16142 
16143  /* "View.MemoryView":718
16144  *
16145  *
16146  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
16147  *
16148  * cdef _memoryviewslice memviewsliceobj
16149  */
16150  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
16151 
16152  /* "View.MemoryView":722
16153  * cdef _memoryviewslice memviewsliceobj
16154  *
16155  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
16156  *
16157  * if isinstance(memview, _memoryviewslice):
16158  */
16159  #ifndef CYTHON_WITHOUT_ASSERTIONS
16160  if (unlikely(!Py_OptimizeFlag)) {
16161  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
16162  PyErr_SetNone(PyExc_AssertionError);
16163  __PYX_ERR(2, 722, __pyx_L1_error)
16164  }
16165  }
16166  #endif
16167 
16168  /* "View.MemoryView":724
16169  * assert memview.view.ndim > 0
16170  *
16171  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16172  * memviewsliceobj = memview
16173  * p_src = &memviewsliceobj.from_slice
16174  */
16175  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16176  __pyx_t_2 = (__pyx_t_1 != 0);
16177  if (__pyx_t_2) {
16178 
16179  /* "View.MemoryView":725
16180  *
16181  * if isinstance(memview, _memoryviewslice):
16182  * memviewsliceobj = memview # <<<<<<<<<<<<<<
16183  * p_src = &memviewsliceobj.from_slice
16184  * else:
16185  */
16186  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 725, __pyx_L1_error)
16187  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16188  __Pyx_INCREF(__pyx_t_3);
16189  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16190  __pyx_t_3 = 0;
16191 
16192  /* "View.MemoryView":726
16193  * if isinstance(memview, _memoryviewslice):
16194  * memviewsliceobj = memview
16195  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
16196  * else:
16197  * slice_copy(memview, &src)
16198  */
16199  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
16200 
16201  /* "View.MemoryView":724
16202  * assert memview.view.ndim > 0
16203  *
16204  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16205  * memviewsliceobj = memview
16206  * p_src = &memviewsliceobj.from_slice
16207  */
16208  goto __pyx_L3;
16209  }
16210 
16211  /* "View.MemoryView":728
16212  * p_src = &memviewsliceobj.from_slice
16213  * else:
16214  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
16215  * p_src = &src
16216  *
16217  */
16218  /*else*/ {
16219  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
16220 
16221  /* "View.MemoryView":729
16222  * else:
16223  * slice_copy(memview, &src)
16224  * p_src = &src # <<<<<<<<<<<<<<
16225  *
16226  *
16227  */
16228  __pyx_v_p_src = (&__pyx_v_src);
16229  }
16230  __pyx_L3:;
16231 
16232  /* "View.MemoryView":735
16233  *
16234  *
16235  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
16236  * dst.data = p_src.data
16237  *
16238  */
16239  __pyx_t_4 = __pyx_v_p_src->memview;
16240  __pyx_v_dst.memview = __pyx_t_4;
16241 
16242  /* "View.MemoryView":736
16243  *
16244  * dst.memview = p_src.memview
16245  * dst.data = p_src.data # <<<<<<<<<<<<<<
16246  *
16247  *
16248  */
16249  __pyx_t_5 = __pyx_v_p_src->data;
16250  __pyx_v_dst.data = __pyx_t_5;
16251 
16252  /* "View.MemoryView":741
16253  *
16254  *
16255  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
16256  * cdef int *p_suboffset_dim = &suboffset_dim
16257  * cdef Py_ssize_t start, stop, step
16258  */
16259  __pyx_v_p_dst = (&__pyx_v_dst);
16260 
16261  /* "View.MemoryView":742
16262  *
16263  * cdef __Pyx_memviewslice *p_dst = &dst
16264  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
16265  * cdef Py_ssize_t start, stop, step
16266  * cdef bint have_start, have_stop, have_step
16267  */
16268  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
16269 
16270  /* "View.MemoryView":746
16271  * cdef bint have_start, have_stop, have_step
16272  *
16273  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16274  * if PyIndex_Check(index):
16275  * slice_memviewslice(
16276  */
16277  __pyx_t_6 = 0;
16278  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
16279  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
16280  __pyx_t_8 = NULL;
16281  } else {
16282  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 746, __pyx_L1_error)
16283  __Pyx_GOTREF(__pyx_t_3);
16284  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 746, __pyx_L1_error)
16285  }
16286  for (;;) {
16287  if (likely(!__pyx_t_8)) {
16288  if (likely(PyList_CheckExact(__pyx_t_3))) {
16289  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
16290  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16291  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
16292  #else
16293  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
16294  __Pyx_GOTREF(__pyx_t_9);
16295  #endif
16296  } else {
16297  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
16298  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16299  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
16300  #else
16301  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
16302  __Pyx_GOTREF(__pyx_t_9);
16303  #endif
16304  }
16305  } else {
16306  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
16307  if (unlikely(!__pyx_t_9)) {
16308  PyObject* exc_type = PyErr_Occurred();
16309  if (exc_type) {
16310  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16311  else __PYX_ERR(2, 746, __pyx_L1_error)
16312  }
16313  break;
16314  }
16315  __Pyx_GOTREF(__pyx_t_9);
16316  }
16317  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
16318  __pyx_t_9 = 0;
16319  __pyx_v_dim = __pyx_t_6;
16320  __pyx_t_6 = (__pyx_t_6 + 1);
16321 
16322  /* "View.MemoryView":747
16323  *
16324  * for dim, index in enumerate(indices):
16325  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
16326  * slice_memviewslice(
16327  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16328  */
16329  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
16330  if (__pyx_t_2) {
16331 
16332  /* "View.MemoryView":751
16333  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16334  * dim, new_ndim, p_suboffset_dim,
16335  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
16336  * 0, 0, 0, # have_{start,stop,step}
16337  * False)
16338  */
16339  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 751, __pyx_L1_error)
16340 
16341  /* "View.MemoryView":748
16342  * for dim, index in enumerate(indices):
16343  * if PyIndex_Check(index):
16344  * slice_memviewslice( # <<<<<<<<<<<<<<
16345  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16346  * dim, new_ndim, p_suboffset_dim,
16347  */
16348  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error)
16349 
16350  /* "View.MemoryView":747
16351  *
16352  * for dim, index in enumerate(indices):
16353  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
16354  * slice_memviewslice(
16355  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16356  */
16357  goto __pyx_L6;
16358  }
16359 
16360  /* "View.MemoryView":754
16361  * 0, 0, 0, # have_{start,stop,step}
16362  * False)
16363  * elif index is None: # <<<<<<<<<<<<<<
16364  * p_dst.shape[new_ndim] = 1
16365  * p_dst.strides[new_ndim] = 0
16366  */
16367  __pyx_t_2 = (__pyx_v_index == Py_None);
16368  __pyx_t_1 = (__pyx_t_2 != 0);
16369  if (__pyx_t_1) {
16370 
16371  /* "View.MemoryView":755
16372  * False)
16373  * elif index is None:
16374  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
16375  * p_dst.strides[new_ndim] = 0
16376  * p_dst.suboffsets[new_ndim] = -1
16377  */
16378  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
16379 
16380  /* "View.MemoryView":756
16381  * elif index is None:
16382  * p_dst.shape[new_ndim] = 1
16383  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
16384  * p_dst.suboffsets[new_ndim] = -1
16385  * new_ndim += 1
16386  */
16387  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
16388 
16389  /* "View.MemoryView":757
16390  * p_dst.shape[new_ndim] = 1
16391  * p_dst.strides[new_ndim] = 0
16392  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
16393  * new_ndim += 1
16394  * else:
16395  */
16396  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
16397 
16398  /* "View.MemoryView":758
16399  * p_dst.strides[new_ndim] = 0
16400  * p_dst.suboffsets[new_ndim] = -1
16401  * new_ndim += 1 # <<<<<<<<<<<<<<
16402  * else:
16403  * start = index.start or 0
16404  */
16405  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16406 
16407  /* "View.MemoryView":754
16408  * 0, 0, 0, # have_{start,stop,step}
16409  * False)
16410  * elif index is None: # <<<<<<<<<<<<<<
16411  * p_dst.shape[new_ndim] = 1
16412  * p_dst.strides[new_ndim] = 0
16413  */
16414  goto __pyx_L6;
16415  }
16416 
16417  /* "View.MemoryView":760
16418  * new_ndim += 1
16419  * else:
16420  * start = index.start or 0 # <<<<<<<<<<<<<<
16421  * stop = index.stop or 0
16422  * step = index.step or 0
16423  */
16424  /*else*/ {
16425  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error)
16426  __Pyx_GOTREF(__pyx_t_9);
16427  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 760, __pyx_L1_error)
16428  if (!__pyx_t_1) {
16429  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16430  } else {
16431  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error)
16432  __pyx_t_10 = __pyx_t_12;
16433  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16434  goto __pyx_L7_bool_binop_done;
16435  }
16436  __pyx_t_10 = 0;
16437  __pyx_L7_bool_binop_done:;
16438  __pyx_v_start = __pyx_t_10;
16439 
16440  /* "View.MemoryView":761
16441  * else:
16442  * start = index.start or 0
16443  * stop = index.stop or 0 # <<<<<<<<<<<<<<
16444  * step = index.step or 0
16445  *
16446  */
16447  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error)
16448  __Pyx_GOTREF(__pyx_t_9);
16449  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 761, __pyx_L1_error)
16450  if (!__pyx_t_1) {
16451  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16452  } else {
16453  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 761, __pyx_L1_error)
16454  __pyx_t_10 = __pyx_t_12;
16455  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16456  goto __pyx_L9_bool_binop_done;
16457  }
16458  __pyx_t_10 = 0;
16459  __pyx_L9_bool_binop_done:;
16460  __pyx_v_stop = __pyx_t_10;
16461 
16462  /* "View.MemoryView":762
16463  * start = index.start or 0
16464  * stop = index.stop or 0
16465  * step = index.step or 0 # <<<<<<<<<<<<<<
16466  *
16467  * have_start = index.start is not None
16468  */
16469  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error)
16470  __Pyx_GOTREF(__pyx_t_9);
16471  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error)
16472  if (!__pyx_t_1) {
16473  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16474  } else {
16475  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
16476  __pyx_t_10 = __pyx_t_12;
16477  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16478  goto __pyx_L11_bool_binop_done;
16479  }
16480  __pyx_t_10 = 0;
16481  __pyx_L11_bool_binop_done:;
16482  __pyx_v_step = __pyx_t_10;
16483 
16484  /* "View.MemoryView":764
16485  * step = index.step or 0
16486  *
16487  * have_start = index.start is not None # <<<<<<<<<<<<<<
16488  * have_stop = index.stop is not None
16489  * have_step = index.step is not None
16490  */
16491  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error)
16492  __Pyx_GOTREF(__pyx_t_9);
16493  __pyx_t_1 = (__pyx_t_9 != Py_None);
16494  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16495  __pyx_v_have_start = __pyx_t_1;
16496 
16497  /* "View.MemoryView":765
16498  *
16499  * have_start = index.start is not None
16500  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
16501  * have_step = index.step is not None
16502  *
16503  */
16504  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 765, __pyx_L1_error)
16505  __Pyx_GOTREF(__pyx_t_9);
16506  __pyx_t_1 = (__pyx_t_9 != Py_None);
16507  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16508  __pyx_v_have_stop = __pyx_t_1;
16509 
16510  /* "View.MemoryView":766
16511  * have_start = index.start is not None
16512  * have_stop = index.stop is not None
16513  * have_step = index.step is not None # <<<<<<<<<<<<<<
16514  *
16515  * slice_memviewslice(
16516  */
16517  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error)
16518  __Pyx_GOTREF(__pyx_t_9);
16519  __pyx_t_1 = (__pyx_t_9 != Py_None);
16520  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16521  __pyx_v_have_step = __pyx_t_1;
16522 
16523  /* "View.MemoryView":768
16524  * have_step = index.step is not None
16525  *
16526  * slice_memviewslice( # <<<<<<<<<<<<<<
16527  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16528  * dim, new_ndim, p_suboffset_dim,
16529  */
16530  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 768, __pyx_L1_error)
16531 
16532  /* "View.MemoryView":774
16533  * have_start, have_stop, have_step,
16534  * True)
16535  * new_ndim += 1 # <<<<<<<<<<<<<<
16536  *
16537  * if isinstance(memview, _memoryviewslice):
16538  */
16539  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16540  }
16541  __pyx_L6:;
16542 
16543  /* "View.MemoryView":746
16544  * cdef bint have_start, have_stop, have_step
16545  *
16546  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16547  * if PyIndex_Check(index):
16548  * slice_memviewslice(
16549  */
16550  }
16551  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16552 
16553  /* "View.MemoryView":776
16554  * new_ndim += 1
16555  *
16556  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16557  * return memoryview_fromslice(dst, new_ndim,
16558  * memviewsliceobj.to_object_func,
16559  */
16560  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16561  __pyx_t_2 = (__pyx_t_1 != 0);
16562  if (__pyx_t_2) {
16563 
16564  /* "View.MemoryView":777
16565  *
16566  * if isinstance(memview, _memoryviewslice):
16567  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16568  * memviewsliceobj.to_object_func,
16569  * memviewsliceobj.to_dtype_func,
16570  */
16571  __Pyx_XDECREF(((PyObject *)__pyx_r));
16572 
16573  /* "View.MemoryView":778
16574  * if isinstance(memview, _memoryviewslice):
16575  * return memoryview_fromslice(dst, new_ndim,
16576  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
16577  * memviewsliceobj.to_dtype_func,
16578  * memview.dtype_is_object)
16579  */
16580  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 778, __pyx_L1_error) }
16581 
16582  /* "View.MemoryView":779
16583  * return memoryview_fromslice(dst, new_ndim,
16584  * memviewsliceobj.to_object_func,
16585  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
16586  * memview.dtype_is_object)
16587  * else:
16588  */
16589  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) }
16590 
16591  /* "View.MemoryView":777
16592  *
16593  * if isinstance(memview, _memoryviewslice):
16594  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16595  * memviewsliceobj.to_object_func,
16596  * memviewsliceobj.to_dtype_func,
16597  */
16598  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error)
16599  __Pyx_GOTREF(__pyx_t_3);
16600  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error)
16601  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16602  __pyx_t_3 = 0;
16603  goto __pyx_L0;
16604 
16605  /* "View.MemoryView":776
16606  * new_ndim += 1
16607  *
16608  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16609  * return memoryview_fromslice(dst, new_ndim,
16610  * memviewsliceobj.to_object_func,
16611  */
16612  }
16613 
16614  /* "View.MemoryView":782
16615  * memview.dtype_is_object)
16616  * else:
16617  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16618  * memview.dtype_is_object)
16619  *
16620  */
16621  /*else*/ {
16622  __Pyx_XDECREF(((PyObject *)__pyx_r));
16623 
16624  /* "View.MemoryView":783
16625  * else:
16626  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
16627  * memview.dtype_is_object) # <<<<<<<<<<<<<<
16628  *
16629  *
16630  */
16631  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 782, __pyx_L1_error)
16632  __Pyx_GOTREF(__pyx_t_3);
16633 
16634  /* "View.MemoryView":782
16635  * memview.dtype_is_object)
16636  * else:
16637  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16638  * memview.dtype_is_object)
16639  *
16640  */
16641  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 782, __pyx_L1_error)
16642  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16643  __pyx_t_3 = 0;
16644  goto __pyx_L0;
16645  }
16646 
16647  /* "View.MemoryView":710
16648  *
16649  * @cname('__pyx_memview_slice')
16650  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16651  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16652  * cdef bint negative_step
16653  */
16654 
16655  /* function exit code */
16656  __pyx_L1_error:;
16657  __Pyx_XDECREF(__pyx_t_3);
16658  __Pyx_XDECREF(__pyx_t_9);
16659  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16660  __pyx_r = 0;
16661  __pyx_L0:;
16662  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16663  __Pyx_XDECREF(__pyx_v_index);
16664  __Pyx_XGIVEREF((PyObject *)__pyx_r);
16665  __Pyx_RefNannyFinishContext();
16666  return __pyx_r;
16667 }
16668 
16669 /* "View.MemoryView":807
16670  *
16671  * @cname('__pyx_memoryview_slice_memviewslice')
16672  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16673  * __Pyx_memviewslice *dst,
16674  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16675  */
16676 
16677 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
16678  Py_ssize_t __pyx_v_new_shape;
16679  int __pyx_v_negative_step;
16680  int __pyx_r;
16681  int __pyx_t_1;
16682  int __pyx_t_2;
16683  int __pyx_t_3;
16684 
16685  /* "View.MemoryView":827
16686  * cdef bint negative_step
16687  *
16688  * if not is_slice: # <<<<<<<<<<<<<<
16689  *
16690  * if start < 0:
16691  */
16692  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16693  if (__pyx_t_1) {
16694 
16695  /* "View.MemoryView":829
16696  * if not is_slice:
16697  *
16698  * if start < 0: # <<<<<<<<<<<<<<
16699  * start += shape
16700  * if not 0 <= start < shape:
16701  */
16702  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16703  if (__pyx_t_1) {
16704 
16705  /* "View.MemoryView":830
16706  *
16707  * if start < 0:
16708  * start += shape # <<<<<<<<<<<<<<
16709  * if not 0 <= start < shape:
16710  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16711  */
16712  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16713 
16714  /* "View.MemoryView":829
16715  * if not is_slice:
16716  *
16717  * if start < 0: # <<<<<<<<<<<<<<
16718  * start += shape
16719  * if not 0 <= start < shape:
16720  */
16721  }
16722 
16723  /* "View.MemoryView":831
16724  * if start < 0:
16725  * start += shape
16726  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16727  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16728  * else:
16729  */
16730  __pyx_t_1 = (0 <= __pyx_v_start);
16731  if (__pyx_t_1) {
16732  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16733  }
16734  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16735  if (__pyx_t_2) {
16736 
16737  /* "View.MemoryView":832
16738  * start += shape
16739  * if not 0 <= start < shape:
16740  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
16741  * else:
16742  *
16743  */
16744  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error)
16745 
16746  /* "View.MemoryView":831
16747  * if start < 0:
16748  * start += shape
16749  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16750  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16751  * else:
16752  */
16753  }
16754 
16755  /* "View.MemoryView":827
16756  * cdef bint negative_step
16757  *
16758  * if not is_slice: # <<<<<<<<<<<<<<
16759  *
16760  * if start < 0:
16761  */
16762  goto __pyx_L3;
16763  }
16764 
16765  /* "View.MemoryView":835
16766  * else:
16767  *
16768  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
16769  *
16770  * if have_step and step == 0:
16771  */
16772  /*else*/ {
16773  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16774  if (__pyx_t_1) {
16775  } else {
16776  __pyx_t_2 = __pyx_t_1;
16777  goto __pyx_L6_bool_binop_done;
16778  }
16779  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16780  __pyx_t_2 = __pyx_t_1;
16781  __pyx_L6_bool_binop_done:;
16782  __pyx_v_negative_step = __pyx_t_2;
16783 
16784  /* "View.MemoryView":837
16785  * negative_step = have_step != 0 and step < 0
16786  *
16787  * if have_step and step == 0: # <<<<<<<<<<<<<<
16788  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16789  *
16790  */
16791  __pyx_t_1 = (__pyx_v_have_step != 0);
16792  if (__pyx_t_1) {
16793  } else {
16794  __pyx_t_2 = __pyx_t_1;
16795  goto __pyx_L9_bool_binop_done;
16796  }
16797  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16798  __pyx_t_2 = __pyx_t_1;
16799  __pyx_L9_bool_binop_done:;
16800  if (__pyx_t_2) {
16801 
16802  /* "View.MemoryView":838
16803  *
16804  * if have_step and step == 0:
16805  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
16806  *
16807  *
16808  */
16809  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error)
16810 
16811  /* "View.MemoryView":837
16812  * negative_step = have_step != 0 and step < 0
16813  *
16814  * if have_step and step == 0: # <<<<<<<<<<<<<<
16815  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16816  *
16817  */
16818  }
16819 
16820  /* "View.MemoryView":841
16821  *
16822  *
16823  * if have_start: # <<<<<<<<<<<<<<
16824  * if start < 0:
16825  * start += shape
16826  */
16827  __pyx_t_2 = (__pyx_v_have_start != 0);
16828  if (__pyx_t_2) {
16829 
16830  /* "View.MemoryView":842
16831  *
16832  * if have_start:
16833  * if start < 0: # <<<<<<<<<<<<<<
16834  * start += shape
16835  * if start < 0:
16836  */
16837  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16838  if (__pyx_t_2) {
16839 
16840  /* "View.MemoryView":843
16841  * if have_start:
16842  * if start < 0:
16843  * start += shape # <<<<<<<<<<<<<<
16844  * if start < 0:
16845  * start = 0
16846  */
16847  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16848 
16849  /* "View.MemoryView":844
16850  * if start < 0:
16851  * start += shape
16852  * if start < 0: # <<<<<<<<<<<<<<
16853  * start = 0
16854  * elif start >= shape:
16855  */
16856  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16857  if (__pyx_t_2) {
16858 
16859  /* "View.MemoryView":845
16860  * start += shape
16861  * if start < 0:
16862  * start = 0 # <<<<<<<<<<<<<<
16863  * elif start >= shape:
16864  * if negative_step:
16865  */
16866  __pyx_v_start = 0;
16867 
16868  /* "View.MemoryView":844
16869  * if start < 0:
16870  * start += shape
16871  * if start < 0: # <<<<<<<<<<<<<<
16872  * start = 0
16873  * elif start >= shape:
16874  */
16875  }
16876 
16877  /* "View.MemoryView":842
16878  *
16879  * if have_start:
16880  * if start < 0: # <<<<<<<<<<<<<<
16881  * start += shape
16882  * if start < 0:
16883  */
16884  goto __pyx_L12;
16885  }
16886 
16887  /* "View.MemoryView":846
16888  * if start < 0:
16889  * start = 0
16890  * elif start >= shape: # <<<<<<<<<<<<<<
16891  * if negative_step:
16892  * start = shape - 1
16893  */
16894  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16895  if (__pyx_t_2) {
16896 
16897  /* "View.MemoryView":847
16898  * start = 0
16899  * elif start >= shape:
16900  * if negative_step: # <<<<<<<<<<<<<<
16901  * start = shape - 1
16902  * else:
16903  */
16904  __pyx_t_2 = (__pyx_v_negative_step != 0);
16905  if (__pyx_t_2) {
16906 
16907  /* "View.MemoryView":848
16908  * elif start >= shape:
16909  * if negative_step:
16910  * start = shape - 1 # <<<<<<<<<<<<<<
16911  * else:
16912  * start = shape
16913  */
16914  __pyx_v_start = (__pyx_v_shape - 1);
16915 
16916  /* "View.MemoryView":847
16917  * start = 0
16918  * elif start >= shape:
16919  * if negative_step: # <<<<<<<<<<<<<<
16920  * start = shape - 1
16921  * else:
16922  */
16923  goto __pyx_L14;
16924  }
16925 
16926  /* "View.MemoryView":850
16927  * start = shape - 1
16928  * else:
16929  * start = shape # <<<<<<<<<<<<<<
16930  * else:
16931  * if negative_step:
16932  */
16933  /*else*/ {
16934  __pyx_v_start = __pyx_v_shape;
16935  }
16936  __pyx_L14:;
16937 
16938  /* "View.MemoryView":846
16939  * if start < 0:
16940  * start = 0
16941  * elif start >= shape: # <<<<<<<<<<<<<<
16942  * if negative_step:
16943  * start = shape - 1
16944  */
16945  }
16946  __pyx_L12:;
16947 
16948  /* "View.MemoryView":841
16949  *
16950  *
16951  * if have_start: # <<<<<<<<<<<<<<
16952  * if start < 0:
16953  * start += shape
16954  */
16955  goto __pyx_L11;
16956  }
16957 
16958  /* "View.MemoryView":852
16959  * start = shape
16960  * else:
16961  * if negative_step: # <<<<<<<<<<<<<<
16962  * start = shape - 1
16963  * else:
16964  */
16965  /*else*/ {
16966  __pyx_t_2 = (__pyx_v_negative_step != 0);
16967  if (__pyx_t_2) {
16968 
16969  /* "View.MemoryView":853
16970  * else:
16971  * if negative_step:
16972  * start = shape - 1 # <<<<<<<<<<<<<<
16973  * else:
16974  * start = 0
16975  */
16976  __pyx_v_start = (__pyx_v_shape - 1);
16977 
16978  /* "View.MemoryView":852
16979  * start = shape
16980  * else:
16981  * if negative_step: # <<<<<<<<<<<<<<
16982  * start = shape - 1
16983  * else:
16984  */
16985  goto __pyx_L15;
16986  }
16987 
16988  /* "View.MemoryView":855
16989  * start = shape - 1
16990  * else:
16991  * start = 0 # <<<<<<<<<<<<<<
16992  *
16993  * if have_stop:
16994  */
16995  /*else*/ {
16996  __pyx_v_start = 0;
16997  }
16998  __pyx_L15:;
16999  }
17000  __pyx_L11:;
17001 
17002  /* "View.MemoryView":857
17003  * start = 0
17004  *
17005  * if have_stop: # <<<<<<<<<<<<<<
17006  * if stop < 0:
17007  * stop += shape
17008  */
17009  __pyx_t_2 = (__pyx_v_have_stop != 0);
17010  if (__pyx_t_2) {
17011 
17012  /* "View.MemoryView":858
17013  *
17014  * if have_stop:
17015  * if stop < 0: # <<<<<<<<<<<<<<
17016  * stop += shape
17017  * if stop < 0:
17018  */
17019  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17020  if (__pyx_t_2) {
17021 
17022  /* "View.MemoryView":859
17023  * if have_stop:
17024  * if stop < 0:
17025  * stop += shape # <<<<<<<<<<<<<<
17026  * if stop < 0:
17027  * stop = 0
17028  */
17029  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
17030 
17031  /* "View.MemoryView":860
17032  * if stop < 0:
17033  * stop += shape
17034  * if stop < 0: # <<<<<<<<<<<<<<
17035  * stop = 0
17036  * elif stop > shape:
17037  */
17038  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17039  if (__pyx_t_2) {
17040 
17041  /* "View.MemoryView":861
17042  * stop += shape
17043  * if stop < 0:
17044  * stop = 0 # <<<<<<<<<<<<<<
17045  * elif stop > shape:
17046  * stop = shape
17047  */
17048  __pyx_v_stop = 0;
17049 
17050  /* "View.MemoryView":860
17051  * if stop < 0:
17052  * stop += shape
17053  * if stop < 0: # <<<<<<<<<<<<<<
17054  * stop = 0
17055  * elif stop > shape:
17056  */
17057  }
17058 
17059  /* "View.MemoryView":858
17060  *
17061  * if have_stop:
17062  * if stop < 0: # <<<<<<<<<<<<<<
17063  * stop += shape
17064  * if stop < 0:
17065  */
17066  goto __pyx_L17;
17067  }
17068 
17069  /* "View.MemoryView":862
17070  * if stop < 0:
17071  * stop = 0
17072  * elif stop > shape: # <<<<<<<<<<<<<<
17073  * stop = shape
17074  * else:
17075  */
17076  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
17077  if (__pyx_t_2) {
17078 
17079  /* "View.MemoryView":863
17080  * stop = 0
17081  * elif stop > shape:
17082  * stop = shape # <<<<<<<<<<<<<<
17083  * else:
17084  * if negative_step:
17085  */
17086  __pyx_v_stop = __pyx_v_shape;
17087 
17088  /* "View.MemoryView":862
17089  * if stop < 0:
17090  * stop = 0
17091  * elif stop > shape: # <<<<<<<<<<<<<<
17092  * stop = shape
17093  * else:
17094  */
17095  }
17096  __pyx_L17:;
17097 
17098  /* "View.MemoryView":857
17099  * start = 0
17100  *
17101  * if have_stop: # <<<<<<<<<<<<<<
17102  * if stop < 0:
17103  * stop += shape
17104  */
17105  goto __pyx_L16;
17106  }
17107 
17108  /* "View.MemoryView":865
17109  * stop = shape
17110  * else:
17111  * if negative_step: # <<<<<<<<<<<<<<
17112  * stop = -1
17113  * else:
17114  */
17115  /*else*/ {
17116  __pyx_t_2 = (__pyx_v_negative_step != 0);
17117  if (__pyx_t_2) {
17118 
17119  /* "View.MemoryView":866
17120  * else:
17121  * if negative_step:
17122  * stop = -1 # <<<<<<<<<<<<<<
17123  * else:
17124  * stop = shape
17125  */
17126  __pyx_v_stop = -1L;
17127 
17128  /* "View.MemoryView":865
17129  * stop = shape
17130  * else:
17131  * if negative_step: # <<<<<<<<<<<<<<
17132  * stop = -1
17133  * else:
17134  */
17135  goto __pyx_L19;
17136  }
17137 
17138  /* "View.MemoryView":868
17139  * stop = -1
17140  * else:
17141  * stop = shape # <<<<<<<<<<<<<<
17142  *
17143  * if not have_step:
17144  */
17145  /*else*/ {
17146  __pyx_v_stop = __pyx_v_shape;
17147  }
17148  __pyx_L19:;
17149  }
17150  __pyx_L16:;
17151 
17152  /* "View.MemoryView":870
17153  * stop = shape
17154  *
17155  * if not have_step: # <<<<<<<<<<<<<<
17156  * step = 1
17157  *
17158  */
17159  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
17160  if (__pyx_t_2) {
17161 
17162  /* "View.MemoryView":871
17163  *
17164  * if not have_step:
17165  * step = 1 # <<<<<<<<<<<<<<
17166  *
17167  *
17168  */
17169  __pyx_v_step = 1;
17170 
17171  /* "View.MemoryView":870
17172  * stop = shape
17173  *
17174  * if not have_step: # <<<<<<<<<<<<<<
17175  * step = 1
17176  *
17177  */
17178  }
17179 
17180  /* "View.MemoryView":875
17181  *
17182  * with cython.cdivision(True):
17183  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
17184  *
17185  * if (stop - start) - step * new_shape:
17186  */
17187  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
17188 
17189  /* "View.MemoryView":877
17190  * new_shape = (stop - start) // step
17191  *
17192  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
17193  * new_shape += 1
17194  *
17195  */
17196  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
17197  if (__pyx_t_2) {
17198 
17199  /* "View.MemoryView":878
17200  *
17201  * if (stop - start) - step * new_shape:
17202  * new_shape += 1 # <<<<<<<<<<<<<<
17203  *
17204  * if new_shape < 0:
17205  */
17206  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
17207 
17208  /* "View.MemoryView":877
17209  * new_shape = (stop - start) // step
17210  *
17211  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
17212  * new_shape += 1
17213  *
17214  */
17215  }
17216 
17217  /* "View.MemoryView":880
17218  * new_shape += 1
17219  *
17220  * if new_shape < 0: # <<<<<<<<<<<<<<
17221  * new_shape = 0
17222  *
17223  */
17224  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
17225  if (__pyx_t_2) {
17226 
17227  /* "View.MemoryView":881
17228  *
17229  * if new_shape < 0:
17230  * new_shape = 0 # <<<<<<<<<<<<<<
17231  *
17232  *
17233  */
17234  __pyx_v_new_shape = 0;
17235 
17236  /* "View.MemoryView":880
17237  * new_shape += 1
17238  *
17239  * if new_shape < 0: # <<<<<<<<<<<<<<
17240  * new_shape = 0
17241  *
17242  */
17243  }
17244 
17245  /* "View.MemoryView":884
17246  *
17247  *
17248  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
17249  * dst.shape[new_ndim] = new_shape
17250  * dst.suboffsets[new_ndim] = suboffset
17251  */
17252  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
17253 
17254  /* "View.MemoryView":885
17255  *
17256  * dst.strides[new_ndim] = stride * step
17257  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
17258  * dst.suboffsets[new_ndim] = suboffset
17259  *
17260  */
17261  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
17262 
17263  /* "View.MemoryView":886
17264  * dst.strides[new_ndim] = stride * step
17265  * dst.shape[new_ndim] = new_shape
17266  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
17267  *
17268  *
17269  */
17270  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
17271  }
17272  __pyx_L3:;
17273 
17274  /* "View.MemoryView":889
17275  *
17276  *
17277  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
17278  * dst.data += start * stride
17279  * else:
17280  */
17281  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
17282  if (__pyx_t_2) {
17283 
17284  /* "View.MemoryView":890
17285  *
17286  * if suboffset_dim[0] < 0:
17287  * dst.data += start * stride # <<<<<<<<<<<<<<
17288  * else:
17289  * dst.suboffsets[suboffset_dim[0]] += start * stride
17290  */
17291  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
17292 
17293  /* "View.MemoryView":889
17294  *
17295  *
17296  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
17297  * dst.data += start * stride
17298  * else:
17299  */
17300  goto __pyx_L23;
17301  }
17302 
17303  /* "View.MemoryView":892
17304  * dst.data += start * stride
17305  * else:
17306  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
17307  *
17308  * if suboffset >= 0:
17309  */
17310  /*else*/ {
17311  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
17312  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
17313  }
17314  __pyx_L23:;
17315 
17316  /* "View.MemoryView":894
17317  * dst.suboffsets[suboffset_dim[0]] += start * stride
17318  *
17319  * if suboffset >= 0: # <<<<<<<<<<<<<<
17320  * if not is_slice:
17321  * if new_ndim == 0:
17322  */
17323  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17324  if (__pyx_t_2) {
17325 
17326  /* "View.MemoryView":895
17327  *
17328  * if suboffset >= 0:
17329  * if not is_slice: # <<<<<<<<<<<<<<
17330  * if new_ndim == 0:
17331  * dst.data = (<char **> dst.data)[0] + suboffset
17332  */
17333  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
17334  if (__pyx_t_2) {
17335 
17336  /* "View.MemoryView":896
17337  * if suboffset >= 0:
17338  * if not is_slice:
17339  * if new_ndim == 0: # <<<<<<<<<<<<<<
17340  * dst.data = (<char **> dst.data)[0] + suboffset
17341  * else:
17342  */
17343  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
17344  if (__pyx_t_2) {
17345 
17346  /* "View.MemoryView":897
17347  * if not is_slice:
17348  * if new_ndim == 0:
17349  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
17350  * else:
17351  * _err_dim(IndexError, "All dimensions preceding dimension %d "
17352  */
17353  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
17354 
17355  /* "View.MemoryView":896
17356  * if suboffset >= 0:
17357  * if not is_slice:
17358  * if new_ndim == 0: # <<<<<<<<<<<<<<
17359  * dst.data = (<char **> dst.data)[0] + suboffset
17360  * else:
17361  */
17362  goto __pyx_L26;
17363  }
17364 
17365  /* "View.MemoryView":899
17366  * dst.data = (<char **> dst.data)[0] + suboffset
17367  * else:
17368  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
17369  * "must be indexed and not sliced", dim)
17370  * else:
17371  */
17372  /*else*/ {
17373 
17374  /* "View.MemoryView":900
17375  * else:
17376  * _err_dim(IndexError, "All dimensions preceding dimension %d "
17377  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
17378  * else:
17379  * suboffset_dim[0] = new_ndim
17380  */
17381  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 899, __pyx_L1_error)
17382  }
17383  __pyx_L26:;
17384 
17385  /* "View.MemoryView":895
17386  *
17387  * if suboffset >= 0:
17388  * if not is_slice: # <<<<<<<<<<<<<<
17389  * if new_ndim == 0:
17390  * dst.data = (<char **> dst.data)[0] + suboffset
17391  */
17392  goto __pyx_L25;
17393  }
17394 
17395  /* "View.MemoryView":902
17396  * "must be indexed and not sliced", dim)
17397  * else:
17398  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
17399  *
17400  * return 0
17401  */
17402  /*else*/ {
17403  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
17404  }
17405  __pyx_L25:;
17406 
17407  /* "View.MemoryView":894
17408  * dst.suboffsets[suboffset_dim[0]] += start * stride
17409  *
17410  * if suboffset >= 0: # <<<<<<<<<<<<<<
17411  * if not is_slice:
17412  * if new_ndim == 0:
17413  */
17414  }
17415 
17416  /* "View.MemoryView":904
17417  * suboffset_dim[0] = new_ndim
17418  *
17419  * return 0 # <<<<<<<<<<<<<<
17420  *
17421  *
17422  */
17423  __pyx_r = 0;
17424  goto __pyx_L0;
17425 
17426  /* "View.MemoryView":807
17427  *
17428  * @cname('__pyx_memoryview_slice_memviewslice')
17429  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
17430  * __Pyx_memviewslice *dst,
17431  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
17432  */
17433 
17434  /* function exit code */
17435  __pyx_L1_error:;
17436  {
17437  #ifdef WITH_THREAD
17438  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17439  #endif
17440  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17441  #ifdef WITH_THREAD
17442  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17443  #endif
17444  }
17445  __pyx_r = -1;
17446  __pyx_L0:;
17447  return __pyx_r;
17448 }
17449 
17450 /* "View.MemoryView":910
17451  *
17452  * @cname('__pyx_pybuffer_index')
17453  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17454  * Py_ssize_t dim) except NULL:
17455  * cdef Py_ssize_t shape, stride, suboffset = -1
17456  */
17457 
17458 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
17459  Py_ssize_t __pyx_v_shape;
17460  Py_ssize_t __pyx_v_stride;
17461  Py_ssize_t __pyx_v_suboffset;
17462  Py_ssize_t __pyx_v_itemsize;
17463  char *__pyx_v_resultp;
17464  char *__pyx_r;
17465  __Pyx_RefNannyDeclarations
17466  Py_ssize_t __pyx_t_1;
17467  int __pyx_t_2;
17468  PyObject *__pyx_t_3 = NULL;
17469  PyObject *__pyx_t_4 = NULL;
17470  __Pyx_RefNannySetupContext("pybuffer_index", 0);
17471 
17472  /* "View.MemoryView":912
17473  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
17474  * Py_ssize_t dim) except NULL:
17475  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
17476  * cdef Py_ssize_t itemsize = view.itemsize
17477  * cdef char *resultp
17478  */
17479  __pyx_v_suboffset = -1L;
17480 
17481  /* "View.MemoryView":913
17482  * Py_ssize_t dim) except NULL:
17483  * cdef Py_ssize_t shape, stride, suboffset = -1
17484  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
17485  * cdef char *resultp
17486  *
17487  */
17488  __pyx_t_1 = __pyx_v_view->itemsize;
17489  __pyx_v_itemsize = __pyx_t_1;
17490 
17491  /* "View.MemoryView":916
17492  * cdef char *resultp
17493  *
17494  * if view.ndim == 0: # <<<<<<<<<<<<<<
17495  * shape = view.len / itemsize
17496  * stride = itemsize
17497  */
17498  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17499  if (__pyx_t_2) {
17500 
17501  /* "View.MemoryView":917
17502  *
17503  * if view.ndim == 0:
17504  * shape = view.len / itemsize # <<<<<<<<<<<<<<
17505  * stride = itemsize
17506  * else:
17507  */
17508  if (unlikely(__pyx_v_itemsize == 0)) {
17509  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
17510  __PYX_ERR(2, 917, __pyx_L1_error)
17511  }
17512  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
17513  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
17514  __PYX_ERR(2, 917, __pyx_L1_error)
17515  }
17516  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17517 
17518  /* "View.MemoryView":918
17519  * if view.ndim == 0:
17520  * shape = view.len / itemsize
17521  * stride = itemsize # <<<<<<<<<<<<<<
17522  * else:
17523  * shape = view.shape[dim]
17524  */
17525  __pyx_v_stride = __pyx_v_itemsize;
17526 
17527  /* "View.MemoryView":916
17528  * cdef char *resultp
17529  *
17530  * if view.ndim == 0: # <<<<<<<<<<<<<<
17531  * shape = view.len / itemsize
17532  * stride = itemsize
17533  */
17534  goto __pyx_L3;
17535  }
17536 
17537  /* "View.MemoryView":920
17538  * stride = itemsize
17539  * else:
17540  * shape = view.shape[dim] # <<<<<<<<<<<<<<
17541  * stride = view.strides[dim]
17542  * if view.suboffsets != NULL:
17543  */
17544  /*else*/ {
17545  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17546 
17547  /* "View.MemoryView":921
17548  * else:
17549  * shape = view.shape[dim]
17550  * stride = view.strides[dim] # <<<<<<<<<<<<<<
17551  * if view.suboffsets != NULL:
17552  * suboffset = view.suboffsets[dim]
17553  */
17554  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17555 
17556  /* "View.MemoryView":922
17557  * shape = view.shape[dim]
17558  * stride = view.strides[dim]
17559  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17560  * suboffset = view.suboffsets[dim]
17561  *
17562  */
17563  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17564  if (__pyx_t_2) {
17565 
17566  /* "View.MemoryView":923
17567  * stride = view.strides[dim]
17568  * if view.suboffsets != NULL:
17569  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
17570  *
17571  * if index < 0:
17572  */
17573  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17574 
17575  /* "View.MemoryView":922
17576  * shape = view.shape[dim]
17577  * stride = view.strides[dim]
17578  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17579  * suboffset = view.suboffsets[dim]
17580  *
17581  */
17582  }
17583  }
17584  __pyx_L3:;
17585 
17586  /* "View.MemoryView":925
17587  * suboffset = view.suboffsets[dim]
17588  *
17589  * if index < 0: # <<<<<<<<<<<<<<
17590  * index += view.shape[dim]
17591  * if index < 0:
17592  */
17593  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17594  if (__pyx_t_2) {
17595 
17596  /* "View.MemoryView":926
17597  *
17598  * if index < 0:
17599  * index += view.shape[dim] # <<<<<<<<<<<<<<
17600  * if index < 0:
17601  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17602  */
17603  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17604 
17605  /* "View.MemoryView":927
17606  * if index < 0:
17607  * index += view.shape[dim]
17608  * if index < 0: # <<<<<<<<<<<<<<
17609  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17610  *
17611  */
17612  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17613  if (unlikely(__pyx_t_2)) {
17614 
17615  /* "View.MemoryView":928
17616  * index += view.shape[dim]
17617  * if index < 0:
17618  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17619  *
17620  * if index >= shape:
17621  */
17622  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
17623  __Pyx_GOTREF(__pyx_t_3);
17624  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 928, __pyx_L1_error)
17625  __Pyx_GOTREF(__pyx_t_4);
17626  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17627  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
17628  __Pyx_GOTREF(__pyx_t_3);
17629  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17630  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17631  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17632  __PYX_ERR(2, 928, __pyx_L1_error)
17633 
17634  /* "View.MemoryView":927
17635  * if index < 0:
17636  * index += view.shape[dim]
17637  * if index < 0: # <<<<<<<<<<<<<<
17638  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17639  *
17640  */
17641  }
17642 
17643  /* "View.MemoryView":925
17644  * suboffset = view.suboffsets[dim]
17645  *
17646  * if index < 0: # <<<<<<<<<<<<<<
17647  * index += view.shape[dim]
17648  * if index < 0:
17649  */
17650  }
17651 
17652  /* "View.MemoryView":930
17653  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17654  *
17655  * if index >= shape: # <<<<<<<<<<<<<<
17656  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17657  *
17658  */
17659  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17660  if (unlikely(__pyx_t_2)) {
17661 
17662  /* "View.MemoryView":931
17663  *
17664  * if index >= shape:
17665  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17666  *
17667  * resultp = bufp + index * stride
17668  */
17669  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
17670  __Pyx_GOTREF(__pyx_t_3);
17671  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 931, __pyx_L1_error)
17672  __Pyx_GOTREF(__pyx_t_4);
17673  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17674  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
17675  __Pyx_GOTREF(__pyx_t_3);
17676  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17677  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17678  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17679  __PYX_ERR(2, 931, __pyx_L1_error)
17680 
17681  /* "View.MemoryView":930
17682  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17683  *
17684  * if index >= shape: # <<<<<<<<<<<<<<
17685  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17686  *
17687  */
17688  }
17689 
17690  /* "View.MemoryView":933
17691  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17692  *
17693  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
17694  * if suboffset >= 0:
17695  * resultp = (<char **> resultp)[0] + suboffset
17696  */
17697  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17698 
17699  /* "View.MemoryView":934
17700  *
17701  * resultp = bufp + index * stride
17702  * if suboffset >= 0: # <<<<<<<<<<<<<<
17703  * resultp = (<char **> resultp)[0] + suboffset
17704  *
17705  */
17706  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17707  if (__pyx_t_2) {
17708 
17709  /* "View.MemoryView":935
17710  * resultp = bufp + index * stride
17711  * if suboffset >= 0:
17712  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
17713  *
17714  * return resultp
17715  */
17716  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17717 
17718  /* "View.MemoryView":934
17719  *
17720  * resultp = bufp + index * stride
17721  * if suboffset >= 0: # <<<<<<<<<<<<<<
17722  * resultp = (<char **> resultp)[0] + suboffset
17723  *
17724  */
17725  }
17726 
17727  /* "View.MemoryView":937
17728  * resultp = (<char **> resultp)[0] + suboffset
17729  *
17730  * return resultp # <<<<<<<<<<<<<<
17731  *
17732  *
17733  */
17734  __pyx_r = __pyx_v_resultp;
17735  goto __pyx_L0;
17736 
17737  /* "View.MemoryView":910
17738  *
17739  * @cname('__pyx_pybuffer_index')
17740  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17741  * Py_ssize_t dim) except NULL:
17742  * cdef Py_ssize_t shape, stride, suboffset = -1
17743  */
17744 
17745  /* function exit code */
17746  __pyx_L1_error:;
17747  __Pyx_XDECREF(__pyx_t_3);
17748  __Pyx_XDECREF(__pyx_t_4);
17749  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17750  __pyx_r = NULL;
17751  __pyx_L0:;
17752  __Pyx_RefNannyFinishContext();
17753  return __pyx_r;
17754 }
17755 
17756 /* "View.MemoryView":943
17757  *
17758  * @cname('__pyx_memslice_transpose')
17759  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17760  * cdef int ndim = memslice.memview.view.ndim
17761  *
17762  */
17763 
17764 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17765  int __pyx_v_ndim;
17766  Py_ssize_t *__pyx_v_shape;
17767  Py_ssize_t *__pyx_v_strides;
17768  int __pyx_v_i;
17769  int __pyx_v_j;
17770  int __pyx_r;
17771  int __pyx_t_1;
17772  Py_ssize_t *__pyx_t_2;
17773  long __pyx_t_3;
17774  long __pyx_t_4;
17775  Py_ssize_t __pyx_t_5;
17776  Py_ssize_t __pyx_t_6;
17777  int __pyx_t_7;
17778  int __pyx_t_8;
17779  int __pyx_t_9;
17780 
17781  /* "View.MemoryView":944
17782  * @cname('__pyx_memslice_transpose')
17783  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
17784  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
17785  *
17786  * cdef Py_ssize_t *shape = memslice.shape
17787  */
17788  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17789  __pyx_v_ndim = __pyx_t_1;
17790 
17791  /* "View.MemoryView":946
17792  * cdef int ndim = memslice.memview.view.ndim
17793  *
17794  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
17795  * cdef Py_ssize_t *strides = memslice.strides
17796  *
17797  */
17798  __pyx_t_2 = __pyx_v_memslice->shape;
17799  __pyx_v_shape = __pyx_t_2;
17800 
17801  /* "View.MemoryView":947
17802  *
17803  * cdef Py_ssize_t *shape = memslice.shape
17804  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
17805  *
17806  *
17807  */
17808  __pyx_t_2 = __pyx_v_memslice->strides;
17809  __pyx_v_strides = __pyx_t_2;
17810 
17811  /* "View.MemoryView":951
17812  *
17813  * cdef int i, j
17814  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
17815  * j = ndim - 1 - i
17816  * strides[i], strides[j] = strides[j], strides[i]
17817  */
17818  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17819  __pyx_t_4 = __pyx_t_3;
17820  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17821  __pyx_v_i = __pyx_t_1;
17822 
17823  /* "View.MemoryView":952
17824  * cdef int i, j
17825  * for i in range(ndim / 2):
17826  * j = ndim - 1 - i # <<<<<<<<<<<<<<
17827  * strides[i], strides[j] = strides[j], strides[i]
17828  * shape[i], shape[j] = shape[j], shape[i]
17829  */
17830  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17831 
17832  /* "View.MemoryView":953
17833  * for i in range(ndim / 2):
17834  * j = ndim - 1 - i
17835  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
17836  * shape[i], shape[j] = shape[j], shape[i]
17837  *
17838  */
17839  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17840  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17841  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17842  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17843 
17844  /* "View.MemoryView":954
17845  * j = ndim - 1 - i
17846  * strides[i], strides[j] = strides[j], strides[i]
17847  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
17848  *
17849  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17850  */
17851  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17852  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17853  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17854  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17855 
17856  /* "View.MemoryView":956
17857  * shape[i], shape[j] = shape[j], shape[i]
17858  *
17859  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17860  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17861  *
17862  */
17863  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17864  if (!__pyx_t_8) {
17865  } else {
17866  __pyx_t_7 = __pyx_t_8;
17867  goto __pyx_L6_bool_binop_done;
17868  }
17869  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17870  __pyx_t_7 = __pyx_t_8;
17871  __pyx_L6_bool_binop_done:;
17872  if (__pyx_t_7) {
17873 
17874  /* "View.MemoryView":957
17875  *
17876  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17877  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
17878  *
17879  * return 1
17880  */
17881  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error)
17882 
17883  /* "View.MemoryView":956
17884  * shape[i], shape[j] = shape[j], shape[i]
17885  *
17886  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17887  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17888  *
17889  */
17890  }
17891  }
17892 
17893  /* "View.MemoryView":959
17894  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17895  *
17896  * return 1 # <<<<<<<<<<<<<<
17897  *
17898  *
17899  */
17900  __pyx_r = 1;
17901  goto __pyx_L0;
17902 
17903  /* "View.MemoryView":943
17904  *
17905  * @cname('__pyx_memslice_transpose')
17906  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17907  * cdef int ndim = memslice.memview.view.ndim
17908  *
17909  */
17910 
17911  /* function exit code */
17912  __pyx_L1_error:;
17913  {
17914  #ifdef WITH_THREAD
17915  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17916  #endif
17917  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17918  #ifdef WITH_THREAD
17919  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17920  #endif
17921  }
17922  __pyx_r = 0;
17923  __pyx_L0:;
17924  return __pyx_r;
17925 }
17926 
17927 /* "View.MemoryView":976
17928  * cdef int (*to_dtype_func)(char *, object) except 0
17929  *
17930  * def __dealloc__(self): # <<<<<<<<<<<<<<
17931  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17932  *
17933  */
17934 
17935 /* Python wrapper */
17936 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17937 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17938  __Pyx_RefNannyDeclarations
17939  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17940  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17941 
17942  /* function exit code */
17943  __Pyx_RefNannyFinishContext();
17944 }
17945 
17946 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17947  __Pyx_RefNannyDeclarations
17948  __Pyx_RefNannySetupContext("__dealloc__", 0);
17949 
17950  /* "View.MemoryView":977
17951  *
17952  * def __dealloc__(self):
17953  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17954  *
17955  * cdef convert_item_to_object(self, char *itemp):
17956  */
17957  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17958 
17959  /* "View.MemoryView":976
17960  * cdef int (*to_dtype_func)(char *, object) except 0
17961  *
17962  * def __dealloc__(self): # <<<<<<<<<<<<<<
17963  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17964  *
17965  */
17966 
17967  /* function exit code */
17968  __Pyx_RefNannyFinishContext();
17969 }
17970 
17971 /* "View.MemoryView":979
17972  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17973  *
17974  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17975  * if self.to_object_func != NULL:
17976  * return self.to_object_func(itemp)
17977  */
17978 
17979 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17980  PyObject *__pyx_r = NULL;
17981  __Pyx_RefNannyDeclarations
17982  int __pyx_t_1;
17983  PyObject *__pyx_t_2 = NULL;
17984  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17985 
17986  /* "View.MemoryView":980
17987  *
17988  * cdef convert_item_to_object(self, char *itemp):
17989  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17990  * return self.to_object_func(itemp)
17991  * else:
17992  */
17993  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17994  if (__pyx_t_1) {
17995 
17996  /* "View.MemoryView":981
17997  * cdef convert_item_to_object(self, char *itemp):
17998  * if self.to_object_func != NULL:
17999  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
18000  * else:
18001  * return memoryview.convert_item_to_object(self, itemp)
18002  */
18003  __Pyx_XDECREF(__pyx_r);
18004  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error)
18005  __Pyx_GOTREF(__pyx_t_2);
18006  __pyx_r = __pyx_t_2;
18007  __pyx_t_2 = 0;
18008  goto __pyx_L0;
18009 
18010  /* "View.MemoryView":980
18011  *
18012  * cdef convert_item_to_object(self, char *itemp):
18013  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
18014  * return self.to_object_func(itemp)
18015  * else:
18016  */
18017  }
18018 
18019  /* "View.MemoryView":983
18020  * return self.to_object_func(itemp)
18021  * else:
18022  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
18023  *
18024  * cdef assign_item_from_object(self, char *itemp, object value):
18025  */
18026  /*else*/ {
18027  __Pyx_XDECREF(__pyx_r);
18028  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error)
18029  __Pyx_GOTREF(__pyx_t_2);
18030  __pyx_r = __pyx_t_2;
18031  __pyx_t_2 = 0;
18032  goto __pyx_L0;
18033  }
18034 
18035  /* "View.MemoryView":979
18036  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
18037  *
18038  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
18039  * if self.to_object_func != NULL:
18040  * return self.to_object_func(itemp)
18041  */
18042 
18043  /* function exit code */
18044  __pyx_L1_error:;
18045  __Pyx_XDECREF(__pyx_t_2);
18046  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18047  __pyx_r = 0;
18048  __pyx_L0:;
18049  __Pyx_XGIVEREF(__pyx_r);
18050  __Pyx_RefNannyFinishContext();
18051  return __pyx_r;
18052 }
18053 
18054 /* "View.MemoryView":985
18055  * return memoryview.convert_item_to_object(self, itemp)
18056  *
18057  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
18058  * if self.to_dtype_func != NULL:
18059  * self.to_dtype_func(itemp, value)
18060  */
18061 
18062 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
18063  PyObject *__pyx_r = NULL;
18064  __Pyx_RefNannyDeclarations
18065  int __pyx_t_1;
18066  int __pyx_t_2;
18067  PyObject *__pyx_t_3 = NULL;
18068  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
18069 
18070  /* "View.MemoryView":986
18071  *
18072  * cdef assign_item_from_object(self, char *itemp, object value):
18073  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
18074  * self.to_dtype_func(itemp, value)
18075  * else:
18076  */
18077  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
18078  if (__pyx_t_1) {
18079 
18080  /* "View.MemoryView":987
18081  * cdef assign_item_from_object(self, char *itemp, object value):
18082  * if self.to_dtype_func != NULL:
18083  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
18084  * else:
18085  * memoryview.assign_item_from_object(self, itemp, value)
18086  */
18087  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error)
18088 
18089  /* "View.MemoryView":986
18090  *
18091  * cdef assign_item_from_object(self, char *itemp, object value):
18092  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
18093  * self.to_dtype_func(itemp, value)
18094  * else:
18095  */
18096  goto __pyx_L3;
18097  }
18098 
18099  /* "View.MemoryView":989
18100  * self.to_dtype_func(itemp, value)
18101  * else:
18102  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
18103  *
18104  * @property
18105  */
18106  /*else*/ {
18107  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 989, __pyx_L1_error)
18108  __Pyx_GOTREF(__pyx_t_3);
18109  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18110  }
18111  __pyx_L3:;
18112 
18113  /* "View.MemoryView":985
18114  * return memoryview.convert_item_to_object(self, itemp)
18115  *
18116  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
18117  * if self.to_dtype_func != NULL:
18118  * self.to_dtype_func(itemp, value)
18119  */
18120 
18121  /* function exit code */
18122  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18123  goto __pyx_L0;
18124  __pyx_L1_error:;
18125  __Pyx_XDECREF(__pyx_t_3);
18126  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18127  __pyx_r = 0;
18128  __pyx_L0:;
18129  __Pyx_XGIVEREF(__pyx_r);
18130  __Pyx_RefNannyFinishContext();
18131  return __pyx_r;
18132 }
18133 
18134 /* "View.MemoryView":992
18135  *
18136  * @property
18137  * def base(self): # <<<<<<<<<<<<<<
18138  * return self.from_object
18139  *
18140  */
18141 
18142 /* Python wrapper */
18143 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
18144 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
18145  PyObject *__pyx_r = 0;
18146  __Pyx_RefNannyDeclarations
18147  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18148  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18149 
18150  /* function exit code */
18151  __Pyx_RefNannyFinishContext();
18152  return __pyx_r;
18153 }
18154 
18155 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18156  PyObject *__pyx_r = NULL;
18157  __Pyx_RefNannyDeclarations
18158  __Pyx_RefNannySetupContext("__get__", 0);
18159 
18160  /* "View.MemoryView":993
18161  * @property
18162  * def base(self):
18163  * return self.from_object # <<<<<<<<<<<<<<
18164  *
18165  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
18166  */
18167  __Pyx_XDECREF(__pyx_r);
18168  __Pyx_INCREF(__pyx_v_self->from_object);
18169  __pyx_r = __pyx_v_self->from_object;
18170  goto __pyx_L0;
18171 
18172  /* "View.MemoryView":992
18173  *
18174  * @property
18175  * def base(self): # <<<<<<<<<<<<<<
18176  * return self.from_object
18177  *
18178  */
18179 
18180  /* function exit code */
18181  __pyx_L0:;
18182  __Pyx_XGIVEREF(__pyx_r);
18183  __Pyx_RefNannyFinishContext();
18184  return __pyx_r;
18185 }
18186 
18187 /* "(tree fragment)":1
18188  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18189  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18190  * def __setstate_cython__(self, __pyx_state):
18191  */
18192 
18193 /* Python wrapper */
18194 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
18195 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18196  PyObject *__pyx_r = 0;
18197  __Pyx_RefNannyDeclarations
18198  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
18199  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18200 
18201  /* function exit code */
18202  __Pyx_RefNannyFinishContext();
18203  return __pyx_r;
18204 }
18205 
18206 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18207  PyObject *__pyx_r = NULL;
18208  __Pyx_RefNannyDeclarations
18209  PyObject *__pyx_t_1 = NULL;
18210  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
18211 
18212  /* "(tree fragment)":2
18213  * def __reduce_cython__(self):
18214  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18215  * def __setstate_cython__(self, __pyx_state):
18216  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18217  */
18218  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
18219  __Pyx_GOTREF(__pyx_t_1);
18220  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18221  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18222  __PYX_ERR(2, 2, __pyx_L1_error)
18223 
18224  /* "(tree fragment)":1
18225  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18226  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18227  * def __setstate_cython__(self, __pyx_state):
18228  */
18229 
18230  /* function exit code */
18231  __pyx_L1_error:;
18232  __Pyx_XDECREF(__pyx_t_1);
18233  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18234  __pyx_r = NULL;
18235  __Pyx_XGIVEREF(__pyx_r);
18236  __Pyx_RefNannyFinishContext();
18237  return __pyx_r;
18238 }
18239 
18240 /* "(tree fragment)":3
18241  * def __reduce_cython__(self):
18242  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18243  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18244  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18245  */
18246 
18247 /* Python wrapper */
18248 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
18249 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18250  PyObject *__pyx_r = 0;
18251  __Pyx_RefNannyDeclarations
18252  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
18253  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18254 
18255  /* function exit code */
18256  __Pyx_RefNannyFinishContext();
18257  return __pyx_r;
18258 }
18259 
18260 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18261  PyObject *__pyx_r = NULL;
18262  __Pyx_RefNannyDeclarations
18263  PyObject *__pyx_t_1 = NULL;
18264  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
18265 
18266  /* "(tree fragment)":4
18267  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18268  * def __setstate_cython__(self, __pyx_state):
18269  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18270  */
18271  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
18272  __Pyx_GOTREF(__pyx_t_1);
18273  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18274  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18275  __PYX_ERR(2, 4, __pyx_L1_error)
18276 
18277  /* "(tree fragment)":3
18278  * def __reduce_cython__(self):
18279  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18280  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18281  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18282  */
18283 
18284  /* function exit code */
18285  __pyx_L1_error:;
18286  __Pyx_XDECREF(__pyx_t_1);
18287  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18288  __pyx_r = NULL;
18289  __Pyx_XGIVEREF(__pyx_r);
18290  __Pyx_RefNannyFinishContext();
18291  return __pyx_r;
18292 }
18293 
18294 /* "View.MemoryView":999
18295  *
18296  * @cname('__pyx_memoryview_fromslice')
18297  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18298  * int ndim,
18299  * object (*to_object_func)(char *),
18300  */
18301 
18302 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
18303  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
18304  Py_ssize_t __pyx_v_suboffset;
18305  PyObject *__pyx_v_length = NULL;
18306  PyObject *__pyx_r = NULL;
18307  __Pyx_RefNannyDeclarations
18308  int __pyx_t_1;
18309  PyObject *__pyx_t_2 = NULL;
18310  PyObject *__pyx_t_3 = NULL;
18311  __Pyx_TypeInfo *__pyx_t_4;
18312  Py_buffer __pyx_t_5;
18313  Py_ssize_t *__pyx_t_6;
18314  Py_ssize_t *__pyx_t_7;
18315  Py_ssize_t *__pyx_t_8;
18316  Py_ssize_t __pyx_t_9;
18317  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
18318 
18319  /* "View.MemoryView":1007
18320  * cdef _memoryviewslice result
18321  *
18322  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
18323  * return None
18324  *
18325  */
18326  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
18327  if (__pyx_t_1) {
18328 
18329  /* "View.MemoryView":1008
18330  *
18331  * if <PyObject *> memviewslice.memview == Py_None:
18332  * return None # <<<<<<<<<<<<<<
18333  *
18334  *
18335  */
18336  __Pyx_XDECREF(__pyx_r);
18337  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18338  goto __pyx_L0;
18339 
18340  /* "View.MemoryView":1007
18341  * cdef _memoryviewslice result
18342  *
18343  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
18344  * return None
18345  *
18346  */
18347  }
18348 
18349  /* "View.MemoryView":1013
18350  *
18351  *
18352  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
18353  *
18354  * result.from_slice = memviewslice
18355  */
18356  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
18357  __Pyx_GOTREF(__pyx_t_2);
18358  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error)
18359  __Pyx_GOTREF(__pyx_t_3);
18360  __Pyx_INCREF(Py_None);
18361  __Pyx_GIVEREF(Py_None);
18362  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
18363  __Pyx_INCREF(__pyx_int_0);
18364  __Pyx_GIVEREF(__pyx_int_0);
18365  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
18366  __Pyx_GIVEREF(__pyx_t_2);
18367  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18368  __pyx_t_2 = 0;
18369  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
18370  __Pyx_GOTREF(__pyx_t_2);
18371  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18372  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
18373  __pyx_t_2 = 0;
18374 
18375  /* "View.MemoryView":1015
18376  * result = _memoryviewslice(None, 0, dtype_is_object)
18377  *
18378  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
18379  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18380  *
18381  */
18382  __pyx_v_result->from_slice = __pyx_v_memviewslice;
18383 
18384  /* "View.MemoryView":1016
18385  *
18386  * result.from_slice = memviewslice
18387  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
18388  *
18389  * result.from_object = (<memoryview> memviewslice.memview).base
18390  */
18391  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
18392 
18393  /* "View.MemoryView":1018
18394  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18395  *
18396  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
18397  * result.typeinfo = memviewslice.memview.typeinfo
18398  *
18399  */
18400  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error)
18401  __Pyx_GOTREF(__pyx_t_2);
18402  __Pyx_GIVEREF(__pyx_t_2);
18403  __Pyx_GOTREF(__pyx_v_result->from_object);
18404  __Pyx_DECREF(__pyx_v_result->from_object);
18405  __pyx_v_result->from_object = __pyx_t_2;
18406  __pyx_t_2 = 0;
18407 
18408  /* "View.MemoryView":1019
18409  *
18410  * result.from_object = (<memoryview> memviewslice.memview).base
18411  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
18412  *
18413  * result.view = memviewslice.memview.view
18414  */
18415  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
18416  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
18417 
18418  /* "View.MemoryView":1021
18419  * result.typeinfo = memviewslice.memview.typeinfo
18420  *
18421  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
18422  * result.view.buf = <void *> memviewslice.data
18423  * result.view.ndim = ndim
18424  */
18425  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
18426  __pyx_v_result->__pyx_base.view = __pyx_t_5;
18427 
18428  /* "View.MemoryView":1022
18429  *
18430  * result.view = memviewslice.memview.view
18431  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
18432  * result.view.ndim = ndim
18433  * (<__pyx_buffer *> &result.view).obj = Py_None
18434  */
18435  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
18436 
18437  /* "View.MemoryView":1023
18438  * result.view = memviewslice.memview.view
18439  * result.view.buf = <void *> memviewslice.data
18440  * result.view.ndim = ndim # <<<<<<<<<<<<<<
18441  * (<__pyx_buffer *> &result.view).obj = Py_None
18442  * Py_INCREF(Py_None)
18443  */
18444  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18445 
18446  /* "View.MemoryView":1024
18447  * result.view.buf = <void *> memviewslice.data
18448  * result.view.ndim = ndim
18449  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
18450  * Py_INCREF(Py_None)
18451  *
18452  */
18453  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18454 
18455  /* "View.MemoryView":1025
18456  * result.view.ndim = ndim
18457  * (<__pyx_buffer *> &result.view).obj = Py_None
18458  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
18459  *
18460  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18461  */
18462  Py_INCREF(Py_None);
18463 
18464  /* "View.MemoryView":1027
18465  * Py_INCREF(Py_None)
18466  *
18467  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18468  * result.flags = PyBUF_RECORDS
18469  * else:
18470  */
18471  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18472  if (__pyx_t_1) {
18473 
18474  /* "View.MemoryView":1028
18475  *
18476  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18477  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
18478  * else:
18479  * result.flags = PyBUF_RECORDS_RO
18480  */
18481  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18482 
18483  /* "View.MemoryView":1027
18484  * Py_INCREF(Py_None)
18485  *
18486  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18487  * result.flags = PyBUF_RECORDS
18488  * else:
18489  */
18490  goto __pyx_L4;
18491  }
18492 
18493  /* "View.MemoryView":1030
18494  * result.flags = PyBUF_RECORDS
18495  * else:
18496  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
18497  *
18498  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18499  */
18500  /*else*/ {
18501  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18502  }
18503  __pyx_L4:;
18504 
18505  /* "View.MemoryView":1032
18506  * result.flags = PyBUF_RECORDS_RO
18507  *
18508  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
18509  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
18510  *
18511  */
18512  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18513 
18514  /* "View.MemoryView":1033
18515  *
18516  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18517  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
18518  *
18519  *
18520  */
18521  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18522 
18523  /* "View.MemoryView":1036
18524  *
18525  *
18526  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
18527  * for suboffset in result.from_slice.suboffsets[:ndim]:
18528  * if suboffset >= 0:
18529  */
18530  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18531 
18532  /* "View.MemoryView":1037
18533  *
18534  * result.view.suboffsets = NULL
18535  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
18536  * if suboffset >= 0:
18537  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18538  */
18539  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18540  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18541  __pyx_t_6 = __pyx_t_8;
18542  __pyx_v_suboffset = (__pyx_t_6[0]);
18543 
18544  /* "View.MemoryView":1038
18545  * result.view.suboffsets = NULL
18546  * for suboffset in result.from_slice.suboffsets[:ndim]:
18547  * if suboffset >= 0: # <<<<<<<<<<<<<<
18548  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18549  * break
18550  */
18551  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18552  if (__pyx_t_1) {
18553 
18554  /* "View.MemoryView":1039
18555  * for suboffset in result.from_slice.suboffsets[:ndim]:
18556  * if suboffset >= 0:
18557  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
18558  * break
18559  *
18560  */
18561  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18562 
18563  /* "View.MemoryView":1040
18564  * if suboffset >= 0:
18565  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18566  * break # <<<<<<<<<<<<<<
18567  *
18568  * result.view.len = result.view.itemsize
18569  */
18570  goto __pyx_L6_break;
18571 
18572  /* "View.MemoryView":1038
18573  * result.view.suboffsets = NULL
18574  * for suboffset in result.from_slice.suboffsets[:ndim]:
18575  * if suboffset >= 0: # <<<<<<<<<<<<<<
18576  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18577  * break
18578  */
18579  }
18580  }
18581  __pyx_L6_break:;
18582 
18583  /* "View.MemoryView":1042
18584  * break
18585  *
18586  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
18587  * for length in result.view.shape[:ndim]:
18588  * result.view.len *= length
18589  */
18590  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18591  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18592 
18593  /* "View.MemoryView":1043
18594  *
18595  * result.view.len = result.view.itemsize
18596  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
18597  * result.view.len *= length
18598  *
18599  */
18600  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18601  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18602  __pyx_t_6 = __pyx_t_8;
18603  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error)
18604  __Pyx_GOTREF(__pyx_t_2);
18605  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18606  __pyx_t_2 = 0;
18607 
18608  /* "View.MemoryView":1044
18609  * result.view.len = result.view.itemsize
18610  * for length in result.view.shape[:ndim]:
18611  * result.view.len *= length # <<<<<<<<<<<<<<
18612  *
18613  * result.to_object_func = to_object_func
18614  */
18615  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error)
18616  __Pyx_GOTREF(__pyx_t_2);
18617  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error)
18618  __Pyx_GOTREF(__pyx_t_3);
18619  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18620  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error)
18621  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18622  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18623  }
18624 
18625  /* "View.MemoryView":1046
18626  * result.view.len *= length
18627  *
18628  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
18629  * result.to_dtype_func = to_dtype_func
18630  *
18631  */
18632  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18633 
18634  /* "View.MemoryView":1047
18635  *
18636  * result.to_object_func = to_object_func
18637  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
18638  *
18639  * return result
18640  */
18641  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18642 
18643  /* "View.MemoryView":1049
18644  * result.to_dtype_func = to_dtype_func
18645  *
18646  * return result # <<<<<<<<<<<<<<
18647  *
18648  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18649  */
18650  __Pyx_XDECREF(__pyx_r);
18651  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18652  __pyx_r = ((PyObject *)__pyx_v_result);
18653  goto __pyx_L0;
18654 
18655  /* "View.MemoryView":999
18656  *
18657  * @cname('__pyx_memoryview_fromslice')
18658  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18659  * int ndim,
18660  * object (*to_object_func)(char *),
18661  */
18662 
18663  /* function exit code */
18664  __pyx_L1_error:;
18665  __Pyx_XDECREF(__pyx_t_2);
18666  __Pyx_XDECREF(__pyx_t_3);
18667  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18668  __pyx_r = 0;
18669  __pyx_L0:;
18670  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18671  __Pyx_XDECREF(__pyx_v_length);
18672  __Pyx_XGIVEREF(__pyx_r);
18673  __Pyx_RefNannyFinishContext();
18674  return __pyx_r;
18675 }
18676 
18677 /* "View.MemoryView":1052
18678  *
18679  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18680  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18681  * __Pyx_memviewslice *mslice) except NULL:
18682  * cdef _memoryviewslice obj
18683  */
18684 
18685 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18686  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18687  __Pyx_memviewslice *__pyx_r;
18688  __Pyx_RefNannyDeclarations
18689  int __pyx_t_1;
18690  int __pyx_t_2;
18691  PyObject *__pyx_t_3 = NULL;
18692  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
18693 
18694  /* "View.MemoryView":1055
18695  * __Pyx_memviewslice *mslice) except NULL:
18696  * cdef _memoryviewslice obj
18697  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18698  * obj = memview
18699  * return &obj.from_slice
18700  */
18701  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18702  __pyx_t_2 = (__pyx_t_1 != 0);
18703  if (__pyx_t_2) {
18704 
18705  /* "View.MemoryView":1056
18706  * cdef _memoryviewslice obj
18707  * if isinstance(memview, _memoryviewslice):
18708  * obj = memview # <<<<<<<<<<<<<<
18709  * return &obj.from_slice
18710  * else:
18711  */
18712  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error)
18713  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18714  __Pyx_INCREF(__pyx_t_3);
18715  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18716  __pyx_t_3 = 0;
18717 
18718  /* "View.MemoryView":1057
18719  * if isinstance(memview, _memoryviewslice):
18720  * obj = memview
18721  * return &obj.from_slice # <<<<<<<<<<<<<<
18722  * else:
18723  * slice_copy(memview, mslice)
18724  */
18725  __pyx_r = (&__pyx_v_obj->from_slice);
18726  goto __pyx_L0;
18727 
18728  /* "View.MemoryView":1055
18729  * __Pyx_memviewslice *mslice) except NULL:
18730  * cdef _memoryviewslice obj
18731  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18732  * obj = memview
18733  * return &obj.from_slice
18734  */
18735  }
18736 
18737  /* "View.MemoryView":1059
18738  * return &obj.from_slice
18739  * else:
18740  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
18741  * return mslice
18742  *
18743  */
18744  /*else*/ {
18745  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18746 
18747  /* "View.MemoryView":1060
18748  * else:
18749  * slice_copy(memview, mslice)
18750  * return mslice # <<<<<<<<<<<<<<
18751  *
18752  * @cname('__pyx_memoryview_slice_copy')
18753  */
18754  __pyx_r = __pyx_v_mslice;
18755  goto __pyx_L0;
18756  }
18757 
18758  /* "View.MemoryView":1052
18759  *
18760  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18761  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18762  * __Pyx_memviewslice *mslice) except NULL:
18763  * cdef _memoryviewslice obj
18764  */
18765 
18766  /* function exit code */
18767  __pyx_L1_error:;
18768  __Pyx_XDECREF(__pyx_t_3);
18769  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18770  __pyx_r = NULL;
18771  __pyx_L0:;
18772  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18773  __Pyx_RefNannyFinishContext();
18774  return __pyx_r;
18775 }
18776 
18777 /* "View.MemoryView":1063
18778  *
18779  * @cname('__pyx_memoryview_slice_copy')
18780  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18781  * cdef int dim
18782  * cdef (Py_ssize_t*) shape, strides, suboffsets
18783  */
18784 
18785 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18786  int __pyx_v_dim;
18787  Py_ssize_t *__pyx_v_shape;
18788  Py_ssize_t *__pyx_v_strides;
18789  Py_ssize_t *__pyx_v_suboffsets;
18790  __Pyx_RefNannyDeclarations
18791  Py_ssize_t *__pyx_t_1;
18792  int __pyx_t_2;
18793  int __pyx_t_3;
18794  int __pyx_t_4;
18795  Py_ssize_t __pyx_t_5;
18796  __Pyx_RefNannySetupContext("slice_copy", 0);
18797 
18798  /* "View.MemoryView":1067
18799  * cdef (Py_ssize_t*) shape, strides, suboffsets
18800  *
18801  * shape = memview.view.shape # <<<<<<<<<<<<<<
18802  * strides = memview.view.strides
18803  * suboffsets = memview.view.suboffsets
18804  */
18805  __pyx_t_1 = __pyx_v_memview->view.shape;
18806  __pyx_v_shape = __pyx_t_1;
18807 
18808  /* "View.MemoryView":1068
18809  *
18810  * shape = memview.view.shape
18811  * strides = memview.view.strides # <<<<<<<<<<<<<<
18812  * suboffsets = memview.view.suboffsets
18813  *
18814  */
18815  __pyx_t_1 = __pyx_v_memview->view.strides;
18816  __pyx_v_strides = __pyx_t_1;
18817 
18818  /* "View.MemoryView":1069
18819  * shape = memview.view.shape
18820  * strides = memview.view.strides
18821  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
18822  *
18823  * dst.memview = <__pyx_memoryview *> memview
18824  */
18825  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18826  __pyx_v_suboffsets = __pyx_t_1;
18827 
18828  /* "View.MemoryView":1071
18829  * suboffsets = memview.view.suboffsets
18830  *
18831  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
18832  * dst.data = <char *> memview.view.buf
18833  *
18834  */
18835  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
18836 
18837  /* "View.MemoryView":1072
18838  *
18839  * dst.memview = <__pyx_memoryview *> memview
18840  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
18841  *
18842  * for dim in range(memview.view.ndim):
18843  */
18844  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
18845 
18846  /* "View.MemoryView":1074
18847  * dst.data = <char *> memview.view.buf
18848  *
18849  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
18850  * dst.shape[dim] = shape[dim]
18851  * dst.strides[dim] = strides[dim]
18852  */
18853  __pyx_t_2 = __pyx_v_memview->view.ndim;
18854  __pyx_t_3 = __pyx_t_2;
18855  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18856  __pyx_v_dim = __pyx_t_4;
18857 
18858  /* "View.MemoryView":1075
18859  *
18860  * for dim in range(memview.view.ndim):
18861  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
18862  * dst.strides[dim] = strides[dim]
18863  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18864  */
18865  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18866 
18867  /* "View.MemoryView":1076
18868  * for dim in range(memview.view.ndim):
18869  * dst.shape[dim] = shape[dim]
18870  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
18871  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18872  *
18873  */
18874  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18875 
18876  /* "View.MemoryView":1077
18877  * dst.shape[dim] = shape[dim]
18878  * dst.strides[dim] = strides[dim]
18879  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18880  *
18881  * @cname('__pyx_memoryview_copy_object')
18882  */
18883  if ((__pyx_v_suboffsets != 0)) {
18884  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18885  } else {
18886  __pyx_t_5 = -1L;
18887  }
18888  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18889  }
18890 
18891  /* "View.MemoryView":1063
18892  *
18893  * @cname('__pyx_memoryview_slice_copy')
18894  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18895  * cdef int dim
18896  * cdef (Py_ssize_t*) shape, strides, suboffsets
18897  */
18898 
18899  /* function exit code */
18900  __Pyx_RefNannyFinishContext();
18901 }
18902 
18903 /* "View.MemoryView":1080
18904  *
18905  * @cname('__pyx_memoryview_copy_object')
18906  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18907  * "Create a new memoryview object"
18908  * cdef __Pyx_memviewslice memviewslice
18909  */
18910 
18911 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18912  __Pyx_memviewslice __pyx_v_memviewslice;
18913  PyObject *__pyx_r = NULL;
18914  __Pyx_RefNannyDeclarations
18915  PyObject *__pyx_t_1 = NULL;
18916  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18917 
18918  /* "View.MemoryView":1083
18919  * "Create a new memoryview object"
18920  * cdef __Pyx_memviewslice memviewslice
18921  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18922  * return memoryview_copy_from_slice(memview, &memviewslice)
18923  *
18924  */
18925  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18926 
18927  /* "View.MemoryView":1084
18928  * cdef __Pyx_memviewslice memviewslice
18929  * slice_copy(memview, &memviewslice)
18930  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18931  *
18932  * @cname('__pyx_memoryview_copy_object_from_slice')
18933  */
18934  __Pyx_XDECREF(__pyx_r);
18935  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error)
18936  __Pyx_GOTREF(__pyx_t_1);
18937  __pyx_r = __pyx_t_1;
18938  __pyx_t_1 = 0;
18939  goto __pyx_L0;
18940 
18941  /* "View.MemoryView":1080
18942  *
18943  * @cname('__pyx_memoryview_copy_object')
18944  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18945  * "Create a new memoryview object"
18946  * cdef __Pyx_memviewslice memviewslice
18947  */
18948 
18949  /* function exit code */
18950  __pyx_L1_error:;
18951  __Pyx_XDECREF(__pyx_t_1);
18952  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18953  __pyx_r = 0;
18954  __pyx_L0:;
18955  __Pyx_XGIVEREF(__pyx_r);
18956  __Pyx_RefNannyFinishContext();
18957  return __pyx_r;
18958 }
18959 
18960 /* "View.MemoryView":1087
18961  *
18962  * @cname('__pyx_memoryview_copy_object_from_slice')
18963  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18964  * """
18965  * Create a new memoryview object from a given memoryview object and slice.
18966  */
18967 
18968 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18969  PyObject *(*__pyx_v_to_object_func)(char *);
18970  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18971  PyObject *__pyx_r = NULL;
18972  __Pyx_RefNannyDeclarations
18973  int __pyx_t_1;
18974  int __pyx_t_2;
18975  PyObject *(*__pyx_t_3)(char *);
18976  int (*__pyx_t_4)(char *, PyObject *);
18977  PyObject *__pyx_t_5 = NULL;
18978  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18979 
18980  /* "View.MemoryView":1094
18981  * cdef int (*to_dtype_func)(char *, object) except 0
18982  *
18983  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18984  * to_object_func = (<_memoryviewslice> memview).to_object_func
18985  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18986  */
18987  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18988  __pyx_t_2 = (__pyx_t_1 != 0);
18989  if (__pyx_t_2) {
18990 
18991  /* "View.MemoryView":1095
18992  *
18993  * if isinstance(memview, _memoryviewslice):
18994  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18995  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18996  * else:
18997  */
18998  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18999  __pyx_v_to_object_func = __pyx_t_3;
19000 
19001  /* "View.MemoryView":1096
19002  * if isinstance(memview, _memoryviewslice):
19003  * to_object_func = (<_memoryviewslice> memview).to_object_func
19004  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
19005  * else:
19006  * to_object_func = NULL
19007  */
19008  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
19009  __pyx_v_to_dtype_func = __pyx_t_4;
19010 
19011  /* "View.MemoryView":1094
19012  * cdef int (*to_dtype_func)(char *, object) except 0
19013  *
19014  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19015  * to_object_func = (<_memoryviewslice> memview).to_object_func
19016  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19017  */
19018  goto __pyx_L3;
19019  }
19020 
19021  /* "View.MemoryView":1098
19022  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19023  * else:
19024  * to_object_func = NULL # <<<<<<<<<<<<<<
19025  * to_dtype_func = NULL
19026  *
19027  */
19028  /*else*/ {
19029  __pyx_v_to_object_func = NULL;
19030 
19031  /* "View.MemoryView":1099
19032  * else:
19033  * to_object_func = NULL
19034  * to_dtype_func = NULL # <<<<<<<<<<<<<<
19035  *
19036  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
19037  */
19038  __pyx_v_to_dtype_func = NULL;
19039  }
19040  __pyx_L3:;
19041 
19042  /* "View.MemoryView":1101
19043  * to_dtype_func = NULL
19044  *
19045  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
19046  * to_object_func, to_dtype_func,
19047  * memview.dtype_is_object)
19048  */
19049  __Pyx_XDECREF(__pyx_r);
19050 
19051  /* "View.MemoryView":1103
19052  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
19053  * to_object_func, to_dtype_func,
19054  * memview.dtype_is_object) # <<<<<<<<<<<<<<
19055  *
19056  *
19057  */
19058  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1101, __pyx_L1_error)
19059  __Pyx_GOTREF(__pyx_t_5);
19060  __pyx_r = __pyx_t_5;
19061  __pyx_t_5 = 0;
19062  goto __pyx_L0;
19063 
19064  /* "View.MemoryView":1087
19065  *
19066  * @cname('__pyx_memoryview_copy_object_from_slice')
19067  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
19068  * """
19069  * Create a new memoryview object from a given memoryview object and slice.
19070  */
19071 
19072  /* function exit code */
19073  __pyx_L1_error:;
19074  __Pyx_XDECREF(__pyx_t_5);
19075  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19076  __pyx_r = 0;
19077  __pyx_L0:;
19078  __Pyx_XGIVEREF(__pyx_r);
19079  __Pyx_RefNannyFinishContext();
19080  return __pyx_r;
19081 }
19082 
19083 /* "View.MemoryView":1109
19084  *
19085  *
19086  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
19087  * if arg < 0:
19088  * return -arg
19089  */
19090 
19091 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
19092  Py_ssize_t __pyx_r;
19093  int __pyx_t_1;
19094 
19095  /* "View.MemoryView":1110
19096  *
19097  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19098  * if arg < 0: # <<<<<<<<<<<<<<
19099  * return -arg
19100  * else:
19101  */
19102  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
19103  if (__pyx_t_1) {
19104 
19105  /* "View.MemoryView":1111
19106  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19107  * if arg < 0:
19108  * return -arg # <<<<<<<<<<<<<<
19109  * else:
19110  * return arg
19111  */
19112  __pyx_r = (-__pyx_v_arg);
19113  goto __pyx_L0;
19114 
19115  /* "View.MemoryView":1110
19116  *
19117  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19118  * if arg < 0: # <<<<<<<<<<<<<<
19119  * return -arg
19120  * else:
19121  */
19122  }
19123 
19124  /* "View.MemoryView":1113
19125  * return -arg
19126  * else:
19127  * return arg # <<<<<<<<<<<<<<
19128  *
19129  * @cname('__pyx_get_best_slice_order')
19130  */
19131  /*else*/ {
19132  __pyx_r = __pyx_v_arg;
19133  goto __pyx_L0;
19134  }
19135 
19136  /* "View.MemoryView":1109
19137  *
19138  *
19139  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
19140  * if arg < 0:
19141  * return -arg
19142  */
19143 
19144  /* function exit code */
19145  __pyx_L0:;
19146  return __pyx_r;
19147 }
19148 
19149 /* "View.MemoryView":1116
19150  *
19151  * @cname('__pyx_get_best_slice_order')
19152  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
19153  * """
19154  * Figure out the best memory access order for a given slice.
19155  */
19156 
19157 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
19158  int __pyx_v_i;
19159  Py_ssize_t __pyx_v_c_stride;
19160  Py_ssize_t __pyx_v_f_stride;
19161  char __pyx_r;
19162  int __pyx_t_1;
19163  int __pyx_t_2;
19164  int __pyx_t_3;
19165  int __pyx_t_4;
19166 
19167  /* "View.MemoryView":1121
19168  * """
19169  * cdef int i
19170  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
19171  * cdef Py_ssize_t f_stride = 0
19172  *
19173  */
19174  __pyx_v_c_stride = 0;
19175 
19176  /* "View.MemoryView":1122
19177  * cdef int i
19178  * cdef Py_ssize_t c_stride = 0
19179  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
19180  *
19181  * for i in range(ndim - 1, -1, -1):
19182  */
19183  __pyx_v_f_stride = 0;
19184 
19185  /* "View.MemoryView":1124
19186  * cdef Py_ssize_t f_stride = 0
19187  *
19188  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19189  * if mslice.shape[i] > 1:
19190  * c_stride = mslice.strides[i]
19191  */
19192  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19193  __pyx_v_i = __pyx_t_1;
19194 
19195  /* "View.MemoryView":1125
19196  *
19197  * for i in range(ndim - 1, -1, -1):
19198  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19199  * c_stride = mslice.strides[i]
19200  * break
19201  */
19202  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19203  if (__pyx_t_2) {
19204 
19205  /* "View.MemoryView":1126
19206  * for i in range(ndim - 1, -1, -1):
19207  * if mslice.shape[i] > 1:
19208  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
19209  * break
19210  *
19211  */
19212  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19213 
19214  /* "View.MemoryView":1127
19215  * if mslice.shape[i] > 1:
19216  * c_stride = mslice.strides[i]
19217  * break # <<<<<<<<<<<<<<
19218  *
19219  * for i in range(ndim):
19220  */
19221  goto __pyx_L4_break;
19222 
19223  /* "View.MemoryView":1125
19224  *
19225  * for i in range(ndim - 1, -1, -1):
19226  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19227  * c_stride = mslice.strides[i]
19228  * break
19229  */
19230  }
19231  }
19232  __pyx_L4_break:;
19233 
19234  /* "View.MemoryView":1129
19235  * break
19236  *
19237  * for i in range(ndim): # <<<<<<<<<<<<<<
19238  * if mslice.shape[i] > 1:
19239  * f_stride = mslice.strides[i]
19240  */
19241  __pyx_t_1 = __pyx_v_ndim;
19242  __pyx_t_3 = __pyx_t_1;
19243  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19244  __pyx_v_i = __pyx_t_4;
19245 
19246  /* "View.MemoryView":1130
19247  *
19248  * for i in range(ndim):
19249  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19250  * f_stride = mslice.strides[i]
19251  * break
19252  */
19253  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19254  if (__pyx_t_2) {
19255 
19256  /* "View.MemoryView":1131
19257  * for i in range(ndim):
19258  * if mslice.shape[i] > 1:
19259  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
19260  * break
19261  *
19262  */
19263  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19264 
19265  /* "View.MemoryView":1132
19266  * if mslice.shape[i] > 1:
19267  * f_stride = mslice.strides[i]
19268  * break # <<<<<<<<<<<<<<
19269  *
19270  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
19271  */
19272  goto __pyx_L7_break;
19273 
19274  /* "View.MemoryView":1130
19275  *
19276  * for i in range(ndim):
19277  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19278  * f_stride = mslice.strides[i]
19279  * break
19280  */
19281  }
19282  }
19283  __pyx_L7_break:;
19284 
19285  /* "View.MemoryView":1134
19286  * break
19287  *
19288  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
19289  * return 'C'
19290  * else:
19291  */
19292  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
19293  if (__pyx_t_2) {
19294 
19295  /* "View.MemoryView":1135
19296  *
19297  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
19298  * return 'C' # <<<<<<<<<<<<<<
19299  * else:
19300  * return 'F'
19301  */
19302  __pyx_r = 'C';
19303  goto __pyx_L0;
19304 
19305  /* "View.MemoryView":1134
19306  * break
19307  *
19308  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
19309  * return 'C'
19310  * else:
19311  */
19312  }
19313 
19314  /* "View.MemoryView":1137
19315  * return 'C'
19316  * else:
19317  * return 'F' # <<<<<<<<<<<<<<
19318  *
19319  * @cython.cdivision(True)
19320  */
19321  /*else*/ {
19322  __pyx_r = 'F';
19323  goto __pyx_L0;
19324  }
19325 
19326  /* "View.MemoryView":1116
19327  *
19328  * @cname('__pyx_get_best_slice_order')
19329  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
19330  * """
19331  * Figure out the best memory access order for a given slice.
19332  */
19333 
19334  /* function exit code */
19335  __pyx_L0:;
19336  return __pyx_r;
19337 }
19338 
19339 /* "View.MemoryView":1140
19340  *
19341  * @cython.cdivision(True)
19342  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19343  * char *dst_data, Py_ssize_t *dst_strides,
19344  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19345  */
19346 
19347 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19348  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19349  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
19350  Py_ssize_t __pyx_v_dst_extent;
19351  Py_ssize_t __pyx_v_src_stride;
19352  Py_ssize_t __pyx_v_dst_stride;
19353  int __pyx_t_1;
19354  int __pyx_t_2;
19355  int __pyx_t_3;
19356  Py_ssize_t __pyx_t_4;
19357  Py_ssize_t __pyx_t_5;
19358  Py_ssize_t __pyx_t_6;
19359 
19360  /* "View.MemoryView":1147
19361  *
19362  * cdef Py_ssize_t i
19363  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
19364  * cdef Py_ssize_t dst_extent = dst_shape[0]
19365  * cdef Py_ssize_t src_stride = src_strides[0]
19366  */
19367  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
19368 
19369  /* "View.MemoryView":1148
19370  * cdef Py_ssize_t i
19371  * cdef Py_ssize_t src_extent = src_shape[0]
19372  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
19373  * cdef Py_ssize_t src_stride = src_strides[0]
19374  * cdef Py_ssize_t dst_stride = dst_strides[0]
19375  */
19376  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
19377 
19378  /* "View.MemoryView":1149
19379  * cdef Py_ssize_t src_extent = src_shape[0]
19380  * cdef Py_ssize_t dst_extent = dst_shape[0]
19381  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
19382  * cdef Py_ssize_t dst_stride = dst_strides[0]
19383  *
19384  */
19385  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
19386 
19387  /* "View.MemoryView":1150
19388  * cdef Py_ssize_t dst_extent = dst_shape[0]
19389  * cdef Py_ssize_t src_stride = src_strides[0]
19390  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
19391  *
19392  * if ndim == 1:
19393  */
19394  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
19395 
19396  /* "View.MemoryView":1152
19397  * cdef Py_ssize_t dst_stride = dst_strides[0]
19398  *
19399  * if ndim == 1: # <<<<<<<<<<<<<<
19400  * if (src_stride > 0 and dst_stride > 0 and
19401  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19402  */
19403  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19404  if (__pyx_t_1) {
19405 
19406  /* "View.MemoryView":1153
19407  *
19408  * if ndim == 1:
19409  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19410  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19411  * memcpy(dst_data, src_data, itemsize * dst_extent)
19412  */
19413  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
19414  if (__pyx_t_2) {
19415  } else {
19416  __pyx_t_1 = __pyx_t_2;
19417  goto __pyx_L5_bool_binop_done;
19418  }
19419  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
19420  if (__pyx_t_2) {
19421  } else {
19422  __pyx_t_1 = __pyx_t_2;
19423  goto __pyx_L5_bool_binop_done;
19424  }
19425 
19426  /* "View.MemoryView":1154
19427  * if ndim == 1:
19428  * if (src_stride > 0 and dst_stride > 0 and
19429  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
19430  * memcpy(dst_data, src_data, itemsize * dst_extent)
19431  * else:
19432  */
19433  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19434  if (__pyx_t_2) {
19435  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19436  }
19437  __pyx_t_3 = (__pyx_t_2 != 0);
19438  __pyx_t_1 = __pyx_t_3;
19439  __pyx_L5_bool_binop_done:;
19440 
19441  /* "View.MemoryView":1153
19442  *
19443  * if ndim == 1:
19444  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19445  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19446  * memcpy(dst_data, src_data, itemsize * dst_extent)
19447  */
19448  if (__pyx_t_1) {
19449 
19450  /* "View.MemoryView":1155
19451  * if (src_stride > 0 and dst_stride > 0 and
19452  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19453  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
19454  * else:
19455  * for i in range(dst_extent):
19456  */
19457  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19458 
19459  /* "View.MemoryView":1153
19460  *
19461  * if ndim == 1:
19462  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19463  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19464  * memcpy(dst_data, src_data, itemsize * dst_extent)
19465  */
19466  goto __pyx_L4;
19467  }
19468 
19469  /* "View.MemoryView":1157
19470  * memcpy(dst_data, src_data, itemsize * dst_extent)
19471  * else:
19472  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19473  * memcpy(dst_data, src_data, itemsize)
19474  * src_data += src_stride
19475  */
19476  /*else*/ {
19477  __pyx_t_4 = __pyx_v_dst_extent;
19478  __pyx_t_5 = __pyx_t_4;
19479  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19480  __pyx_v_i = __pyx_t_6;
19481 
19482  /* "View.MemoryView":1158
19483  * else:
19484  * for i in range(dst_extent):
19485  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
19486  * src_data += src_stride
19487  * dst_data += dst_stride
19488  */
19489  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19490 
19491  /* "View.MemoryView":1159
19492  * for i in range(dst_extent):
19493  * memcpy(dst_data, src_data, itemsize)
19494  * src_data += src_stride # <<<<<<<<<<<<<<
19495  * dst_data += dst_stride
19496  * else:
19497  */
19498  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19499 
19500  /* "View.MemoryView":1160
19501  * memcpy(dst_data, src_data, itemsize)
19502  * src_data += src_stride
19503  * dst_data += dst_stride # <<<<<<<<<<<<<<
19504  * else:
19505  * for i in range(dst_extent):
19506  */
19507  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19508  }
19509  }
19510  __pyx_L4:;
19511 
19512  /* "View.MemoryView":1152
19513  * cdef Py_ssize_t dst_stride = dst_strides[0]
19514  *
19515  * if ndim == 1: # <<<<<<<<<<<<<<
19516  * if (src_stride > 0 and dst_stride > 0 and
19517  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19518  */
19519  goto __pyx_L3;
19520  }
19521 
19522  /* "View.MemoryView":1162
19523  * dst_data += dst_stride
19524  * else:
19525  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19526  * _copy_strided_to_strided(src_data, src_strides + 1,
19527  * dst_data, dst_strides + 1,
19528  */
19529  /*else*/ {
19530  __pyx_t_4 = __pyx_v_dst_extent;
19531  __pyx_t_5 = __pyx_t_4;
19532  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19533  __pyx_v_i = __pyx_t_6;
19534 
19535  /* "View.MemoryView":1163
19536  * else:
19537  * for i in range(dst_extent):
19538  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
19539  * dst_data, dst_strides + 1,
19540  * src_shape + 1, dst_shape + 1,
19541  */
19542  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
19543 
19544  /* "View.MemoryView":1167
19545  * src_shape + 1, dst_shape + 1,
19546  * ndim - 1, itemsize)
19547  * src_data += src_stride # <<<<<<<<<<<<<<
19548  * dst_data += dst_stride
19549  *
19550  */
19551  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19552 
19553  /* "View.MemoryView":1168
19554  * ndim - 1, itemsize)
19555  * src_data += src_stride
19556  * dst_data += dst_stride # <<<<<<<<<<<<<<
19557  *
19558  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
19559  */
19560  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19561  }
19562  }
19563  __pyx_L3:;
19564 
19565  /* "View.MemoryView":1140
19566  *
19567  * @cython.cdivision(True)
19568  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19569  * char *dst_data, Py_ssize_t *dst_strides,
19570  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19571  */
19572 
19573  /* function exit code */
19574 }
19575 
19576 /* "View.MemoryView":1170
19577  * dst_data += dst_stride
19578  *
19579  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19580  * __Pyx_memviewslice *dst,
19581  * int ndim, size_t itemsize) nogil:
19582  */
19583 
19584 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19585 
19586  /* "View.MemoryView":1173
19587  * __Pyx_memviewslice *dst,
19588  * int ndim, size_t itemsize) nogil:
19589  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
19590  * src.shape, dst.shape, ndim, itemsize)
19591  *
19592  */
19593  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19594 
19595  /* "View.MemoryView":1170
19596  * dst_data += dst_stride
19597  *
19598  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19599  * __Pyx_memviewslice *dst,
19600  * int ndim, size_t itemsize) nogil:
19601  */
19602 
19603  /* function exit code */
19604 }
19605 
19606 /* "View.MemoryView":1177
19607  *
19608  * @cname('__pyx_memoryview_slice_get_size')
19609  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19610  * "Return the size of the memory occupied by the slice in number of bytes"
19611  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19612  */
19613 
19614 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
19615  Py_ssize_t __pyx_v_shape;
19616  Py_ssize_t __pyx_v_size;
19617  Py_ssize_t __pyx_r;
19618  Py_ssize_t __pyx_t_1;
19619  Py_ssize_t *__pyx_t_2;
19620  Py_ssize_t *__pyx_t_3;
19621  Py_ssize_t *__pyx_t_4;
19622 
19623  /* "View.MemoryView":1179
19624  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
19625  * "Return the size of the memory occupied by the slice in number of bytes"
19626  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
19627  *
19628  * for shape in src.shape[:ndim]:
19629  */
19630  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19631  __pyx_v_size = __pyx_t_1;
19632 
19633  /* "View.MemoryView":1181
19634  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19635  *
19636  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
19637  * size *= shape
19638  *
19639  */
19640  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
19641  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
19642  __pyx_t_2 = __pyx_t_4;
19643  __pyx_v_shape = (__pyx_t_2[0]);
19644 
19645  /* "View.MemoryView":1182
19646  *
19647  * for shape in src.shape[:ndim]:
19648  * size *= shape # <<<<<<<<<<<<<<
19649  *
19650  * return size
19651  */
19652  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
19653  }
19654 
19655  /* "View.MemoryView":1184
19656  * size *= shape
19657  *
19658  * return size # <<<<<<<<<<<<<<
19659  *
19660  * @cname('__pyx_fill_contig_strides_array')
19661  */
19662  __pyx_r = __pyx_v_size;
19663  goto __pyx_L0;
19664 
19665  /* "View.MemoryView":1177
19666  *
19667  * @cname('__pyx_memoryview_slice_get_size')
19668  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19669  * "Return the size of the memory occupied by the slice in number of bytes"
19670  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19671  */
19672 
19673  /* function exit code */
19674  __pyx_L0:;
19675  return __pyx_r;
19676 }
19677 
19678 /* "View.MemoryView":1187
19679  *
19680  * @cname('__pyx_fill_contig_strides_array')
19681  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19682  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19683  * int ndim, char order) nogil:
19684  */
19685 
19686 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
19687  int __pyx_v_idx;
19688  Py_ssize_t __pyx_r;
19689  int __pyx_t_1;
19690  int __pyx_t_2;
19691  int __pyx_t_3;
19692  int __pyx_t_4;
19693 
19694  /* "View.MemoryView":1196
19695  * cdef int idx
19696  *
19697  * if order == 'F': # <<<<<<<<<<<<<<
19698  * for idx in range(ndim):
19699  * strides[idx] = stride
19700  */
19701  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
19702  if (__pyx_t_1) {
19703 
19704  /* "View.MemoryView":1197
19705  *
19706  * if order == 'F':
19707  * for idx in range(ndim): # <<<<<<<<<<<<<<
19708  * strides[idx] = stride
19709  * stride *= shape[idx]
19710  */
19711  __pyx_t_2 = __pyx_v_ndim;
19712  __pyx_t_3 = __pyx_t_2;
19713  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19714  __pyx_v_idx = __pyx_t_4;
19715 
19716  /* "View.MemoryView":1198
19717  * if order == 'F':
19718  * for idx in range(ndim):
19719  * strides[idx] = stride # <<<<<<<<<<<<<<
19720  * stride *= shape[idx]
19721  * else:
19722  */
19723  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19724 
19725  /* "View.MemoryView":1199
19726  * for idx in range(ndim):
19727  * strides[idx] = stride
19728  * stride *= shape[idx] # <<<<<<<<<<<<<<
19729  * else:
19730  * for idx in range(ndim - 1, -1, -1):
19731  */
19732  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19733  }
19734 
19735  /* "View.MemoryView":1196
19736  * cdef int idx
19737  *
19738  * if order == 'F': # <<<<<<<<<<<<<<
19739  * for idx in range(ndim):
19740  * strides[idx] = stride
19741  */
19742  goto __pyx_L3;
19743  }
19744 
19745  /* "View.MemoryView":1201
19746  * stride *= shape[idx]
19747  * else:
19748  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19749  * strides[idx] = stride
19750  * stride *= shape[idx]
19751  */
19752  /*else*/ {
19753  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19754  __pyx_v_idx = __pyx_t_2;
19755 
19756  /* "View.MemoryView":1202
19757  * else:
19758  * for idx in range(ndim - 1, -1, -1):
19759  * strides[idx] = stride # <<<<<<<<<<<<<<
19760  * stride *= shape[idx]
19761  *
19762  */
19763  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19764 
19765  /* "View.MemoryView":1203
19766  * for idx in range(ndim - 1, -1, -1):
19767  * strides[idx] = stride
19768  * stride *= shape[idx] # <<<<<<<<<<<<<<
19769  *
19770  * return stride
19771  */
19772  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19773  }
19774  }
19775  __pyx_L3:;
19776 
19777  /* "View.MemoryView":1205
19778  * stride *= shape[idx]
19779  *
19780  * return stride # <<<<<<<<<<<<<<
19781  *
19782  * @cname('__pyx_memoryview_copy_data_to_temp')
19783  */
19784  __pyx_r = __pyx_v_stride;
19785  goto __pyx_L0;
19786 
19787  /* "View.MemoryView":1187
19788  *
19789  * @cname('__pyx_fill_contig_strides_array')
19790  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19791  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19792  * int ndim, char order) nogil:
19793  */
19794 
19795  /* function exit code */
19796  __pyx_L0:;
19797  return __pyx_r;
19798 }
19799 
19800 /* "View.MemoryView":1208
19801  *
19802  * @cname('__pyx_memoryview_copy_data_to_temp')
19803  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19804  * __Pyx_memviewslice *tmpslice,
19805  * char order,
19806  */
19807 
19808 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
19809  int __pyx_v_i;
19810  void *__pyx_v_result;
19811  size_t __pyx_v_itemsize;
19812  size_t __pyx_v_size;
19813  void *__pyx_r;
19814  Py_ssize_t __pyx_t_1;
19815  int __pyx_t_2;
19816  int __pyx_t_3;
19817  struct __pyx_memoryview_obj *__pyx_t_4;
19818  int __pyx_t_5;
19819  int __pyx_t_6;
19820 
19821  /* "View.MemoryView":1219
19822  * cdef void *result
19823  *
19824  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19825  * cdef size_t size = slice_get_size(src, ndim)
19826  *
19827  */
19828  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19829  __pyx_v_itemsize = __pyx_t_1;
19830 
19831  /* "View.MemoryView":1220
19832  *
19833  * cdef size_t itemsize = src.memview.view.itemsize
19834  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19835  *
19836  * result = malloc(size)
19837  */
19838  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19839 
19840  /* "View.MemoryView":1222
19841  * cdef size_t size = slice_get_size(src, ndim)
19842  *
19843  * result = malloc(size) # <<<<<<<<<<<<<<
19844  * if not result:
19845  * _err(MemoryError, NULL)
19846  */
19847  __pyx_v_result = malloc(__pyx_v_size);
19848 
19849  /* "View.MemoryView":1223
19850  *
19851  * result = malloc(size)
19852  * if not result: # <<<<<<<<<<<<<<
19853  * _err(MemoryError, NULL)
19854  *
19855  */
19856  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19857  if (__pyx_t_2) {
19858 
19859  /* "View.MemoryView":1224
19860  * result = malloc(size)
19861  * if not result:
19862  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19863  *
19864  *
19865  */
19866  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error)
19867 
19868  /* "View.MemoryView":1223
19869  *
19870  * result = malloc(size)
19871  * if not result: # <<<<<<<<<<<<<<
19872  * _err(MemoryError, NULL)
19873  *
19874  */
19875  }
19876 
19877  /* "View.MemoryView":1227
19878  *
19879  *
19880  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19881  * tmpslice.memview = src.memview
19882  * for i in range(ndim):
19883  */
19884  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19885 
19886  /* "View.MemoryView":1228
19887  *
19888  * tmpslice.data = <char *> result
19889  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19890  * for i in range(ndim):
19891  * tmpslice.shape[i] = src.shape[i]
19892  */
19893  __pyx_t_4 = __pyx_v_src->memview;
19894  __pyx_v_tmpslice->memview = __pyx_t_4;
19895 
19896  /* "View.MemoryView":1229
19897  * tmpslice.data = <char *> result
19898  * tmpslice.memview = src.memview
19899  * for i in range(ndim): # <<<<<<<<<<<<<<
19900  * tmpslice.shape[i] = src.shape[i]
19901  * tmpslice.suboffsets[i] = -1
19902  */
19903  __pyx_t_3 = __pyx_v_ndim;
19904  __pyx_t_5 = __pyx_t_3;
19905  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19906  __pyx_v_i = __pyx_t_6;
19907 
19908  /* "View.MemoryView":1230
19909  * tmpslice.memview = src.memview
19910  * for i in range(ndim):
19911  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19912  * tmpslice.suboffsets[i] = -1
19913  *
19914  */
19915  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19916 
19917  /* "View.MemoryView":1231
19918  * for i in range(ndim):
19919  * tmpslice.shape[i] = src.shape[i]
19920  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19921  *
19922  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19923  */
19924  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19925  }
19926 
19927  /* "View.MemoryView":1233
19928  * tmpslice.suboffsets[i] = -1
19929  *
19930  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19931  * ndim, order)
19932  *
19933  */
19934  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19935 
19936  /* "View.MemoryView":1237
19937  *
19938  *
19939  * for i in range(ndim): # <<<<<<<<<<<<<<
19940  * if tmpslice.shape[i] == 1:
19941  * tmpslice.strides[i] = 0
19942  */
19943  __pyx_t_3 = __pyx_v_ndim;
19944  __pyx_t_5 = __pyx_t_3;
19945  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19946  __pyx_v_i = __pyx_t_6;
19947 
19948  /* "View.MemoryView":1238
19949  *
19950  * for i in range(ndim):
19951  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19952  * tmpslice.strides[i] = 0
19953  *
19954  */
19955  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19956  if (__pyx_t_2) {
19957 
19958  /* "View.MemoryView":1239
19959  * for i in range(ndim):
19960  * if tmpslice.shape[i] == 1:
19961  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19962  *
19963  * if slice_is_contig(src[0], order, ndim):
19964  */
19965  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19966 
19967  /* "View.MemoryView":1238
19968  *
19969  * for i in range(ndim):
19970  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19971  * tmpslice.strides[i] = 0
19972  *
19973  */
19974  }
19975  }
19976 
19977  /* "View.MemoryView":1241
19978  * tmpslice.strides[i] = 0
19979  *
19980  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19981  * memcpy(result, src.data, size)
19982  * else:
19983  */
19984  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19985  if (__pyx_t_2) {
19986 
19987  /* "View.MemoryView":1242
19988  *
19989  * if slice_is_contig(src[0], order, ndim):
19990  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19991  * else:
19992  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19993  */
19994  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19995 
19996  /* "View.MemoryView":1241
19997  * tmpslice.strides[i] = 0
19998  *
19999  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
20000  * memcpy(result, src.data, size)
20001  * else:
20002  */
20003  goto __pyx_L9;
20004  }
20005 
20006  /* "View.MemoryView":1244
20007  * memcpy(result, src.data, size)
20008  * else:
20009  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
20010  *
20011  * return result
20012  */
20013  /*else*/ {
20014  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
20015  }
20016  __pyx_L9:;
20017 
20018  /* "View.MemoryView":1246
20019  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
20020  *
20021  * return result # <<<<<<<<<<<<<<
20022  *
20023  *
20024  */
20025  __pyx_r = __pyx_v_result;
20026  goto __pyx_L0;
20027 
20028  /* "View.MemoryView":1208
20029  *
20030  * @cname('__pyx_memoryview_copy_data_to_temp')
20031  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
20032  * __Pyx_memviewslice *tmpslice,
20033  * char order,
20034  */
20035 
20036  /* function exit code */
20037  __pyx_L1_error:;
20038  {
20039  #ifdef WITH_THREAD
20040  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20041  #endif
20042  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
20043  #ifdef WITH_THREAD
20044  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20045  #endif
20046  }
20047  __pyx_r = NULL;
20048  __pyx_L0:;
20049  return __pyx_r;
20050 }
20051 
20052 /* "View.MemoryView":1251
20053  *
20054  * @cname('__pyx_memoryview_err_extents')
20055  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
20056  * Py_ssize_t extent2) except -1 with gil:
20057  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20058  */
20059 
20060 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
20061  int __pyx_r;
20062  __Pyx_RefNannyDeclarations
20063  PyObject *__pyx_t_1 = NULL;
20064  PyObject *__pyx_t_2 = NULL;
20065  PyObject *__pyx_t_3 = NULL;
20066  PyObject *__pyx_t_4 = NULL;
20067  #ifdef WITH_THREAD
20068  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20069  #endif
20070  __Pyx_RefNannySetupContext("_err_extents", 0);
20071 
20072  /* "View.MemoryView":1254
20073  * Py_ssize_t extent2) except -1 with gil:
20074  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20075  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
20076  *
20077  * @cname('__pyx_memoryview_err_dim')
20078  */
20079  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error)
20080  __Pyx_GOTREF(__pyx_t_1);
20081  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1254, __pyx_L1_error)
20082  __Pyx_GOTREF(__pyx_t_2);
20083  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error)
20084  __Pyx_GOTREF(__pyx_t_3);
20085  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error)
20086  __Pyx_GOTREF(__pyx_t_4);
20087  __Pyx_GIVEREF(__pyx_t_1);
20088  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
20089  __Pyx_GIVEREF(__pyx_t_2);
20090  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
20091  __Pyx_GIVEREF(__pyx_t_3);
20092  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
20093  __pyx_t_1 = 0;
20094  __pyx_t_2 = 0;
20095  __pyx_t_3 = 0;
20096 
20097  /* "View.MemoryView":1253
20098  * cdef int _err_extents(int i, Py_ssize_t extent1,
20099  * Py_ssize_t extent2) except -1 with gil:
20100  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
20101  * (i, extent1, extent2))
20102  *
20103  */
20104  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1253, __pyx_L1_error)
20105  __Pyx_GOTREF(__pyx_t_3);
20106  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20107  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1253, __pyx_L1_error)
20108  __Pyx_GOTREF(__pyx_t_4);
20109  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20110  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20111  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20112  __PYX_ERR(2, 1253, __pyx_L1_error)
20113 
20114  /* "View.MemoryView":1251
20115  *
20116  * @cname('__pyx_memoryview_err_extents')
20117  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
20118  * Py_ssize_t extent2) except -1 with gil:
20119  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20120  */
20121 
20122  /* function exit code */
20123  __pyx_L1_error:;
20124  __Pyx_XDECREF(__pyx_t_1);
20125  __Pyx_XDECREF(__pyx_t_2);
20126  __Pyx_XDECREF(__pyx_t_3);
20127  __Pyx_XDECREF(__pyx_t_4);
20128  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20129  __pyx_r = -1;
20130  __Pyx_RefNannyFinishContext();
20131  #ifdef WITH_THREAD
20132  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20133  #endif
20134  return __pyx_r;
20135 }
20136 
20137 /* "View.MemoryView":1257
20138  *
20139  * @cname('__pyx_memoryview_err_dim')
20140  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
20141  * raise error(msg.decode('ascii') % dim)
20142  *
20143  */
20144 
20145 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
20146  int __pyx_r;
20147  __Pyx_RefNannyDeclarations
20148  PyObject *__pyx_t_1 = NULL;
20149  PyObject *__pyx_t_2 = NULL;
20150  PyObject *__pyx_t_3 = NULL;
20151  PyObject *__pyx_t_4 = NULL;
20152  #ifdef WITH_THREAD
20153  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20154  #endif
20155  __Pyx_RefNannySetupContext("_err_dim", 0);
20156  __Pyx_INCREF(__pyx_v_error);
20157 
20158  /* "View.MemoryView":1258
20159  * @cname('__pyx_memoryview_err_dim')
20160  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
20161  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
20162  *
20163  * @cname('__pyx_memoryview_err')
20164  */
20165  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1258, __pyx_L1_error)
20166  __Pyx_GOTREF(__pyx_t_2);
20167  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1258, __pyx_L1_error)
20168  __Pyx_GOTREF(__pyx_t_3);
20169  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1258, __pyx_L1_error)
20170  __Pyx_GOTREF(__pyx_t_4);
20171  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20172  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20173  __Pyx_INCREF(__pyx_v_error);
20174  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
20175  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
20176  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
20177  if (likely(__pyx_t_2)) {
20178  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
20179  __Pyx_INCREF(__pyx_t_2);
20180  __Pyx_INCREF(function);
20181  __Pyx_DECREF_SET(__pyx_t_3, function);
20182  }
20183  }
20184  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
20185  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20186  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20187  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1258, __pyx_L1_error)
20188  __Pyx_GOTREF(__pyx_t_1);
20189  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20190  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20191  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20192  __PYX_ERR(2, 1258, __pyx_L1_error)
20193 
20194  /* "View.MemoryView":1257
20195  *
20196  * @cname('__pyx_memoryview_err_dim')
20197  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
20198  * raise error(msg.decode('ascii') % dim)
20199  *
20200  */
20201 
20202  /* function exit code */
20203  __pyx_L1_error:;
20204  __Pyx_XDECREF(__pyx_t_1);
20205  __Pyx_XDECREF(__pyx_t_2);
20206  __Pyx_XDECREF(__pyx_t_3);
20207  __Pyx_XDECREF(__pyx_t_4);
20208  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
20209  __pyx_r = -1;
20210  __Pyx_XDECREF(__pyx_v_error);
20211  __Pyx_RefNannyFinishContext();
20212  #ifdef WITH_THREAD
20213  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20214  #endif
20215  return __pyx_r;
20216 }
20217 
20218 /* "View.MemoryView":1261
20219  *
20220  * @cname('__pyx_memoryview_err')
20221  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
20222  * if msg != NULL:
20223  * raise error(msg.decode('ascii'))
20224  */
20225 
20226 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
20227  int __pyx_r;
20228  __Pyx_RefNannyDeclarations
20229  int __pyx_t_1;
20230  PyObject *__pyx_t_2 = NULL;
20231  PyObject *__pyx_t_3 = NULL;
20232  PyObject *__pyx_t_4 = NULL;
20233  PyObject *__pyx_t_5 = NULL;
20234  #ifdef WITH_THREAD
20235  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20236  #endif
20237  __Pyx_RefNannySetupContext("_err", 0);
20238  __Pyx_INCREF(__pyx_v_error);
20239 
20240  /* "View.MemoryView":1262
20241  * @cname('__pyx_memoryview_err')
20242  * cdef int _err(object error, char *msg) except -1 with gil:
20243  * if msg != NULL: # <<<<<<<<<<<<<<
20244  * raise error(msg.decode('ascii'))
20245  * else:
20246  */
20247  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
20248  if (unlikely(__pyx_t_1)) {
20249 
20250  /* "View.MemoryView":1263
20251  * cdef int _err(object error, char *msg) except -1 with gil:
20252  * if msg != NULL:
20253  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
20254  * else:
20255  * raise error
20256  */
20257  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1263, __pyx_L1_error)
20258  __Pyx_GOTREF(__pyx_t_3);
20259  __Pyx_INCREF(__pyx_v_error);
20260  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
20261  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20262  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20263  if (likely(__pyx_t_5)) {
20264  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
20265  __Pyx_INCREF(__pyx_t_5);
20266  __Pyx_INCREF(function);
20267  __Pyx_DECREF_SET(__pyx_t_4, function);
20268  }
20269  }
20270  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
20271  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20272  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20273  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1263, __pyx_L1_error)
20274  __Pyx_GOTREF(__pyx_t_2);
20275  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20276  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20277  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20278  __PYX_ERR(2, 1263, __pyx_L1_error)
20279 
20280  /* "View.MemoryView":1262
20281  * @cname('__pyx_memoryview_err')
20282  * cdef int _err(object error, char *msg) except -1 with gil:
20283  * if msg != NULL: # <<<<<<<<<<<<<<
20284  * raise error(msg.decode('ascii'))
20285  * else:
20286  */
20287  }
20288 
20289  /* "View.MemoryView":1265
20290  * raise error(msg.decode('ascii'))
20291  * else:
20292  * raise error # <<<<<<<<<<<<<<
20293  *
20294  * @cname('__pyx_memoryview_copy_contents')
20295  */
20296  /*else*/ {
20297  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
20298  __PYX_ERR(2, 1265, __pyx_L1_error)
20299  }
20300 
20301  /* "View.MemoryView":1261
20302  *
20303  * @cname('__pyx_memoryview_err')
20304  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
20305  * if msg != NULL:
20306  * raise error(msg.decode('ascii'))
20307  */
20308 
20309  /* function exit code */
20310  __pyx_L1_error:;
20311  __Pyx_XDECREF(__pyx_t_2);
20312  __Pyx_XDECREF(__pyx_t_3);
20313  __Pyx_XDECREF(__pyx_t_4);
20314  __Pyx_XDECREF(__pyx_t_5);
20315  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
20316  __pyx_r = -1;
20317  __Pyx_XDECREF(__pyx_v_error);
20318  __Pyx_RefNannyFinishContext();
20319  #ifdef WITH_THREAD
20320  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20321  #endif
20322  return __pyx_r;
20323 }
20324 
20325 /* "View.MemoryView":1268
20326  *
20327  * @cname('__pyx_memoryview_copy_contents')
20328  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20329  * __Pyx_memviewslice dst,
20330  * int src_ndim, int dst_ndim,
20331  */
20332 
20333 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
20334  void *__pyx_v_tmpdata;
20335  size_t __pyx_v_itemsize;
20336  int __pyx_v_i;
20337  char __pyx_v_order;
20338  int __pyx_v_broadcasting;
20339  int __pyx_v_direct_copy;
20340  __Pyx_memviewslice __pyx_v_tmp;
20341  int __pyx_v_ndim;
20342  int __pyx_r;
20343  Py_ssize_t __pyx_t_1;
20344  int __pyx_t_2;
20345  int __pyx_t_3;
20346  int __pyx_t_4;
20347  int __pyx_t_5;
20348  int __pyx_t_6;
20349  void *__pyx_t_7;
20350  int __pyx_t_8;
20351 
20352  /* "View.MemoryView":1276
20353  * Check for overlapping memory and verify the shapes.
20354  * """
20355  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
20356  * cdef size_t itemsize = src.memview.view.itemsize
20357  * cdef int i
20358  */
20359  __pyx_v_tmpdata = NULL;
20360 
20361  /* "View.MemoryView":1277
20362  * """
20363  * cdef void *tmpdata = NULL
20364  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
20365  * cdef int i
20366  * cdef char order = get_best_order(&src, src_ndim)
20367  */
20368  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
20369  __pyx_v_itemsize = __pyx_t_1;
20370 
20371  /* "View.MemoryView":1279
20372  * cdef size_t itemsize = src.memview.view.itemsize
20373  * cdef int i
20374  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
20375  * cdef bint broadcasting = False
20376  * cdef bint direct_copy = False
20377  */
20378  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
20379 
20380  /* "View.MemoryView":1280
20381  * cdef int i
20382  * cdef char order = get_best_order(&src, src_ndim)
20383  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
20384  * cdef bint direct_copy = False
20385  * cdef __Pyx_memviewslice tmp
20386  */
20387  __pyx_v_broadcasting = 0;
20388 
20389  /* "View.MemoryView":1281
20390  * cdef char order = get_best_order(&src, src_ndim)
20391  * cdef bint broadcasting = False
20392  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
20393  * cdef __Pyx_memviewslice tmp
20394  *
20395  */
20396  __pyx_v_direct_copy = 0;
20397 
20398  /* "View.MemoryView":1284
20399  * cdef __Pyx_memviewslice tmp
20400  *
20401  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20402  * broadcast_leading(&src, src_ndim, dst_ndim)
20403  * elif dst_ndim < src_ndim:
20404  */
20405  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
20406  if (__pyx_t_2) {
20407 
20408  /* "View.MemoryView":1285
20409  *
20410  * if src_ndim < dst_ndim:
20411  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20412  * elif dst_ndim < src_ndim:
20413  * broadcast_leading(&dst, dst_ndim, src_ndim)
20414  */
20415  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20416 
20417  /* "View.MemoryView":1284
20418  * cdef __Pyx_memviewslice tmp
20419  *
20420  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20421  * broadcast_leading(&src, src_ndim, dst_ndim)
20422  * elif dst_ndim < src_ndim:
20423  */
20424  goto __pyx_L3;
20425  }
20426 
20427  /* "View.MemoryView":1286
20428  * if src_ndim < dst_ndim:
20429  * broadcast_leading(&src, src_ndim, dst_ndim)
20430  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20431  * broadcast_leading(&dst, dst_ndim, src_ndim)
20432  *
20433  */
20434  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20435  if (__pyx_t_2) {
20436 
20437  /* "View.MemoryView":1287
20438  * broadcast_leading(&src, src_ndim, dst_ndim)
20439  * elif dst_ndim < src_ndim:
20440  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
20441  *
20442  * cdef int ndim = max(src_ndim, dst_ndim)
20443  */
20444  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20445 
20446  /* "View.MemoryView":1286
20447  * if src_ndim < dst_ndim:
20448  * broadcast_leading(&src, src_ndim, dst_ndim)
20449  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20450  * broadcast_leading(&dst, dst_ndim, src_ndim)
20451  *
20452  */
20453  }
20454  __pyx_L3:;
20455 
20456  /* "View.MemoryView":1289
20457  * broadcast_leading(&dst, dst_ndim, src_ndim)
20458  *
20459  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20460  *
20461  * for i in range(ndim):
20462  */
20463  __pyx_t_3 = __pyx_v_dst_ndim;
20464  __pyx_t_4 = __pyx_v_src_ndim;
20465  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20466  __pyx_t_5 = __pyx_t_3;
20467  } else {
20468  __pyx_t_5 = __pyx_t_4;
20469  }
20470  __pyx_v_ndim = __pyx_t_5;
20471 
20472  /* "View.MemoryView":1291
20473  * cdef int ndim = max(src_ndim, dst_ndim)
20474  *
20475  * for i in range(ndim): # <<<<<<<<<<<<<<
20476  * if src.shape[i] != dst.shape[i]:
20477  * if src.shape[i] == 1:
20478  */
20479  __pyx_t_5 = __pyx_v_ndim;
20480  __pyx_t_3 = __pyx_t_5;
20481  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20482  __pyx_v_i = __pyx_t_4;
20483 
20484  /* "View.MemoryView":1292
20485  *
20486  * for i in range(ndim):
20487  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20488  * if src.shape[i] == 1:
20489  * broadcasting = True
20490  */
20491  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20492  if (__pyx_t_2) {
20493 
20494  /* "View.MemoryView":1293
20495  * for i in range(ndim):
20496  * if src.shape[i] != dst.shape[i]:
20497  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20498  * broadcasting = True
20499  * src.strides[i] = 0
20500  */
20501  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20502  if (__pyx_t_2) {
20503 
20504  /* "View.MemoryView":1294
20505  * if src.shape[i] != dst.shape[i]:
20506  * if src.shape[i] == 1:
20507  * broadcasting = True # <<<<<<<<<<<<<<
20508  * src.strides[i] = 0
20509  * else:
20510  */
20511  __pyx_v_broadcasting = 1;
20512 
20513  /* "View.MemoryView":1295
20514  * if src.shape[i] == 1:
20515  * broadcasting = True
20516  * src.strides[i] = 0 # <<<<<<<<<<<<<<
20517  * else:
20518  * _err_extents(i, dst.shape[i], src.shape[i])
20519  */
20520  (__pyx_v_src.strides[__pyx_v_i]) = 0;
20521 
20522  /* "View.MemoryView":1293
20523  * for i in range(ndim):
20524  * if src.shape[i] != dst.shape[i]:
20525  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20526  * broadcasting = True
20527  * src.strides[i] = 0
20528  */
20529  goto __pyx_L7;
20530  }
20531 
20532  /* "View.MemoryView":1297
20533  * src.strides[i] = 0
20534  * else:
20535  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
20536  *
20537  * if src.suboffsets[i] >= 0:
20538  */
20539  /*else*/ {
20540  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1297, __pyx_L1_error)
20541  }
20542  __pyx_L7:;
20543 
20544  /* "View.MemoryView":1292
20545  *
20546  * for i in range(ndim):
20547  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20548  * if src.shape[i] == 1:
20549  * broadcasting = True
20550  */
20551  }
20552 
20553  /* "View.MemoryView":1299
20554  * _err_extents(i, dst.shape[i], src.shape[i])
20555  *
20556  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20557  * _err_dim(ValueError, "Dimension %d is not direct", i)
20558  *
20559  */
20560  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20561  if (__pyx_t_2) {
20562 
20563  /* "View.MemoryView":1300
20564  *
20565  * if src.suboffsets[i] >= 0:
20566  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
20567  *
20568  * if slices_overlap(&src, &dst, ndim, itemsize):
20569  */
20570  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1300, __pyx_L1_error)
20571 
20572  /* "View.MemoryView":1299
20573  * _err_extents(i, dst.shape[i], src.shape[i])
20574  *
20575  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20576  * _err_dim(ValueError, "Dimension %d is not direct", i)
20577  *
20578  */
20579  }
20580  }
20581 
20582  /* "View.MemoryView":1302
20583  * _err_dim(ValueError, "Dimension %d is not direct", i)
20584  *
20585  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20586  *
20587  * if not slice_is_contig(src, order, ndim):
20588  */
20589  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20590  if (__pyx_t_2) {
20591 
20592  /* "View.MemoryView":1304
20593  * if slices_overlap(&src, &dst, ndim, itemsize):
20594  *
20595  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20596  * order = get_best_order(&dst, ndim)
20597  *
20598  */
20599  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20600  if (__pyx_t_2) {
20601 
20602  /* "View.MemoryView":1305
20603  *
20604  * if not slice_is_contig(src, order, ndim):
20605  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
20606  *
20607  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20608  */
20609  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20610 
20611  /* "View.MemoryView":1304
20612  * if slices_overlap(&src, &dst, ndim, itemsize):
20613  *
20614  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20615  * order = get_best_order(&dst, ndim)
20616  *
20617  */
20618  }
20619 
20620  /* "View.MemoryView":1307
20621  * order = get_best_order(&dst, ndim)
20622  *
20623  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
20624  * src = tmp
20625  *
20626  */
20627  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1307, __pyx_L1_error)
20628  __pyx_v_tmpdata = __pyx_t_7;
20629 
20630  /* "View.MemoryView":1308
20631  *
20632  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20633  * src = tmp # <<<<<<<<<<<<<<
20634  *
20635  * if not broadcasting:
20636  */
20637  __pyx_v_src = __pyx_v_tmp;
20638 
20639  /* "View.MemoryView":1302
20640  * _err_dim(ValueError, "Dimension %d is not direct", i)
20641  *
20642  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20643  *
20644  * if not slice_is_contig(src, order, ndim):
20645  */
20646  }
20647 
20648  /* "View.MemoryView":1310
20649  * src = tmp
20650  *
20651  * if not broadcasting: # <<<<<<<<<<<<<<
20652  *
20653  *
20654  */
20655  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20656  if (__pyx_t_2) {
20657 
20658  /* "View.MemoryView":1313
20659  *
20660  *
20661  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20662  * direct_copy = slice_is_contig(dst, 'C', ndim)
20663  * elif slice_is_contig(src, 'F', ndim):
20664  */
20665  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
20666  if (__pyx_t_2) {
20667 
20668  /* "View.MemoryView":1314
20669  *
20670  * if slice_is_contig(src, 'C', ndim):
20671  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
20672  * elif slice_is_contig(src, 'F', ndim):
20673  * direct_copy = slice_is_contig(dst, 'F', ndim)
20674  */
20675  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
20676 
20677  /* "View.MemoryView":1313
20678  *
20679  *
20680  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20681  * direct_copy = slice_is_contig(dst, 'C', ndim)
20682  * elif slice_is_contig(src, 'F', ndim):
20683  */
20684  goto __pyx_L12;
20685  }
20686 
20687  /* "View.MemoryView":1315
20688  * if slice_is_contig(src, 'C', ndim):
20689  * direct_copy = slice_is_contig(dst, 'C', ndim)
20690  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20691  * direct_copy = slice_is_contig(dst, 'F', ndim)
20692  *
20693  */
20694  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20695  if (__pyx_t_2) {
20696 
20697  /* "View.MemoryView":1316
20698  * direct_copy = slice_is_contig(dst, 'C', ndim)
20699  * elif slice_is_contig(src, 'F', ndim):
20700  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
20701  *
20702  * if direct_copy:
20703  */
20704  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
20705 
20706  /* "View.MemoryView":1315
20707  * if slice_is_contig(src, 'C', ndim):
20708  * direct_copy = slice_is_contig(dst, 'C', ndim)
20709  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20710  * direct_copy = slice_is_contig(dst, 'F', ndim)
20711  *
20712  */
20713  }
20714  __pyx_L12:;
20715 
20716  /* "View.MemoryView":1318
20717  * direct_copy = slice_is_contig(dst, 'F', ndim)
20718  *
20719  * if direct_copy: # <<<<<<<<<<<<<<
20720  *
20721  * refcount_copying(&dst, dtype_is_object, ndim, False)
20722  */
20723  __pyx_t_2 = (__pyx_v_direct_copy != 0);
20724  if (__pyx_t_2) {
20725 
20726  /* "View.MemoryView":1320
20727  * if direct_copy:
20728  *
20729  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20730  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20731  * refcount_copying(&dst, dtype_is_object, ndim, True)
20732  */
20733  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20734 
20735  /* "View.MemoryView":1321
20736  *
20737  * refcount_copying(&dst, dtype_is_object, ndim, False)
20738  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
20739  * refcount_copying(&dst, dtype_is_object, ndim, True)
20740  * free(tmpdata)
20741  */
20742  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20743 
20744  /* "View.MemoryView":1322
20745  * refcount_copying(&dst, dtype_is_object, ndim, False)
20746  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20747  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20748  * free(tmpdata)
20749  * return 0
20750  */
20751  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20752 
20753  /* "View.MemoryView":1323
20754  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20755  * refcount_copying(&dst, dtype_is_object, ndim, True)
20756  * free(tmpdata) # <<<<<<<<<<<<<<
20757  * return 0
20758  *
20759  */
20760  free(__pyx_v_tmpdata);
20761 
20762  /* "View.MemoryView":1324
20763  * refcount_copying(&dst, dtype_is_object, ndim, True)
20764  * free(tmpdata)
20765  * return 0 # <<<<<<<<<<<<<<
20766  *
20767  * if order == 'F' == get_best_order(&dst, ndim):
20768  */
20769  __pyx_r = 0;
20770  goto __pyx_L0;
20771 
20772  /* "View.MemoryView":1318
20773  * direct_copy = slice_is_contig(dst, 'F', ndim)
20774  *
20775  * if direct_copy: # <<<<<<<<<<<<<<
20776  *
20777  * refcount_copying(&dst, dtype_is_object, ndim, False)
20778  */
20779  }
20780 
20781  /* "View.MemoryView":1310
20782  * src = tmp
20783  *
20784  * if not broadcasting: # <<<<<<<<<<<<<<
20785  *
20786  *
20787  */
20788  }
20789 
20790  /* "View.MemoryView":1326
20791  * return 0
20792  *
20793  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20794  *
20795  *
20796  */
20797  __pyx_t_2 = (__pyx_v_order == 'F');
20798  if (__pyx_t_2) {
20799  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20800  }
20801  __pyx_t_8 = (__pyx_t_2 != 0);
20802  if (__pyx_t_8) {
20803 
20804  /* "View.MemoryView":1329
20805  *
20806  *
20807  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20808  * transpose_memslice(&dst)
20809  *
20810  */
20811  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error)
20812 
20813  /* "View.MemoryView":1330
20814  *
20815  * transpose_memslice(&src)
20816  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20817  *
20818  * refcount_copying(&dst, dtype_is_object, ndim, False)
20819  */
20820  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error)
20821 
20822  /* "View.MemoryView":1326
20823  * return 0
20824  *
20825  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20826  *
20827  *
20828  */
20829  }
20830 
20831  /* "View.MemoryView":1332
20832  * transpose_memslice(&dst)
20833  *
20834  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20835  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20836  * refcount_copying(&dst, dtype_is_object, ndim, True)
20837  */
20838  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20839 
20840  /* "View.MemoryView":1333
20841  *
20842  * refcount_copying(&dst, dtype_is_object, ndim, False)
20843  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20844  * refcount_copying(&dst, dtype_is_object, ndim, True)
20845  *
20846  */
20847  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20848 
20849  /* "View.MemoryView":1334
20850  * refcount_copying(&dst, dtype_is_object, ndim, False)
20851  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20852  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20853  *
20854  * free(tmpdata)
20855  */
20856  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20857 
20858  /* "View.MemoryView":1336
20859  * refcount_copying(&dst, dtype_is_object, ndim, True)
20860  *
20861  * free(tmpdata) # <<<<<<<<<<<<<<
20862  * return 0
20863  *
20864  */
20865  free(__pyx_v_tmpdata);
20866 
20867  /* "View.MemoryView":1337
20868  *
20869  * free(tmpdata)
20870  * return 0 # <<<<<<<<<<<<<<
20871  *
20872  * @cname('__pyx_memoryview_broadcast_leading')
20873  */
20874  __pyx_r = 0;
20875  goto __pyx_L0;
20876 
20877  /* "View.MemoryView":1268
20878  *
20879  * @cname('__pyx_memoryview_copy_contents')
20880  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20881  * __Pyx_memviewslice dst,
20882  * int src_ndim, int dst_ndim,
20883  */
20884 
20885  /* function exit code */
20886  __pyx_L1_error:;
20887  {
20888  #ifdef WITH_THREAD
20889  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20890  #endif
20891  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20892  #ifdef WITH_THREAD
20893  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20894  #endif
20895  }
20896  __pyx_r = -1;
20897  __pyx_L0:;
20898  return __pyx_r;
20899 }
20900 
20901 /* "View.MemoryView":1340
20902  *
20903  * @cname('__pyx_memoryview_broadcast_leading')
20904  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20905  * int ndim,
20906  * int ndim_other) nogil:
20907  */
20908 
20909 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20910  int __pyx_v_i;
20911  int __pyx_v_offset;
20912  int __pyx_t_1;
20913  int __pyx_t_2;
20914  int __pyx_t_3;
20915 
20916  /* "View.MemoryView":1344
20917  * int ndim_other) nogil:
20918  * cdef int i
20919  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20920  *
20921  * for i in range(ndim - 1, -1, -1):
20922  */
20923  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20924 
20925  /* "View.MemoryView":1346
20926  * cdef int offset = ndim_other - ndim
20927  *
20928  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20929  * mslice.shape[i + offset] = mslice.shape[i]
20930  * mslice.strides[i + offset] = mslice.strides[i]
20931  */
20932  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20933  __pyx_v_i = __pyx_t_1;
20934 
20935  /* "View.MemoryView":1347
20936  *
20937  * for i in range(ndim - 1, -1, -1):
20938  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20939  * mslice.strides[i + offset] = mslice.strides[i]
20940  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20941  */
20942  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20943 
20944  /* "View.MemoryView":1348
20945  * for i in range(ndim - 1, -1, -1):
20946  * mslice.shape[i + offset] = mslice.shape[i]
20947  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20948  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20949  *
20950  */
20951  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20952 
20953  /* "View.MemoryView":1349
20954  * mslice.shape[i + offset] = mslice.shape[i]
20955  * mslice.strides[i + offset] = mslice.strides[i]
20956  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20957  *
20958  * for i in range(offset):
20959  */
20960  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20961  }
20962 
20963  /* "View.MemoryView":1351
20964  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20965  *
20966  * for i in range(offset): # <<<<<<<<<<<<<<
20967  * mslice.shape[i] = 1
20968  * mslice.strides[i] = mslice.strides[0]
20969  */
20970  __pyx_t_1 = __pyx_v_offset;
20971  __pyx_t_2 = __pyx_t_1;
20972  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20973  __pyx_v_i = __pyx_t_3;
20974 
20975  /* "View.MemoryView":1352
20976  *
20977  * for i in range(offset):
20978  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20979  * mslice.strides[i] = mslice.strides[0]
20980  * mslice.suboffsets[i] = -1
20981  */
20982  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20983 
20984  /* "View.MemoryView":1353
20985  * for i in range(offset):
20986  * mslice.shape[i] = 1
20987  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20988  * mslice.suboffsets[i] = -1
20989  *
20990  */
20991  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20992 
20993  /* "View.MemoryView":1354
20994  * mslice.shape[i] = 1
20995  * mslice.strides[i] = mslice.strides[0]
20996  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20997  *
20998  *
20999  */
21000  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
21001  }
21002 
21003  /* "View.MemoryView":1340
21004  *
21005  * @cname('__pyx_memoryview_broadcast_leading')
21006  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
21007  * int ndim,
21008  * int ndim_other) nogil:
21009  */
21010 
21011  /* function exit code */
21012 }
21013 
21014 /* "View.MemoryView":1362
21015  *
21016  * @cname('__pyx_memoryview_refcount_copying')
21017  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
21018  * int ndim, bint inc) nogil:
21019  *
21020  */
21021 
21022 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
21023  int __pyx_t_1;
21024 
21025  /* "View.MemoryView":1366
21026  *
21027  *
21028  * if dtype_is_object: # <<<<<<<<<<<<<<
21029  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
21030  * dst.strides, ndim, inc)
21031  */
21032  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
21033  if (__pyx_t_1) {
21034 
21035  /* "View.MemoryView":1367
21036  *
21037  * if dtype_is_object:
21038  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
21039  * dst.strides, ndim, inc)
21040  *
21041  */
21042  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
21043 
21044  /* "View.MemoryView":1366
21045  *
21046  *
21047  * if dtype_is_object: # <<<<<<<<<<<<<<
21048  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
21049  * dst.strides, ndim, inc)
21050  */
21051  }
21052 
21053  /* "View.MemoryView":1362
21054  *
21055  * @cname('__pyx_memoryview_refcount_copying')
21056  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
21057  * int ndim, bint inc) nogil:
21058  *
21059  */
21060 
21061  /* function exit code */
21062 }
21063 
21064 /* "View.MemoryView":1371
21065  *
21066  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
21067  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21068  * Py_ssize_t *strides, int ndim,
21069  * bint inc) with gil:
21070  */
21071 
21072 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
21073  __Pyx_RefNannyDeclarations
21074  #ifdef WITH_THREAD
21075  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21076  #endif
21077  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
21078 
21079  /* "View.MemoryView":1374
21080  * Py_ssize_t *strides, int ndim,
21081  * bint inc) with gil:
21082  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
21083  *
21084  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21085  */
21086  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
21087 
21088  /* "View.MemoryView":1371
21089  *
21090  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
21091  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21092  * Py_ssize_t *strides, int ndim,
21093  * bint inc) with gil:
21094  */
21095 
21096  /* function exit code */
21097  __Pyx_RefNannyFinishContext();
21098  #ifdef WITH_THREAD
21099  __Pyx_PyGILState_Release(__pyx_gilstate_save);
21100  #endif
21101 }
21102 
21103 /* "View.MemoryView":1377
21104  *
21105  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21106  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21107  * Py_ssize_t *strides, int ndim, bint inc):
21108  * cdef Py_ssize_t i
21109  */
21110 
21111 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
21112  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21113  __Pyx_RefNannyDeclarations
21114  Py_ssize_t __pyx_t_1;
21115  Py_ssize_t __pyx_t_2;
21116  Py_ssize_t __pyx_t_3;
21117  int __pyx_t_4;
21118  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
21119 
21120  /* "View.MemoryView":1381
21121  * cdef Py_ssize_t i
21122  *
21123  * for i in range(shape[0]): # <<<<<<<<<<<<<<
21124  * if ndim == 1:
21125  * if inc:
21126  */
21127  __pyx_t_1 = (__pyx_v_shape[0]);
21128  __pyx_t_2 = __pyx_t_1;
21129  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21130  __pyx_v_i = __pyx_t_3;
21131 
21132  /* "View.MemoryView":1382
21133  *
21134  * for i in range(shape[0]):
21135  * if ndim == 1: # <<<<<<<<<<<<<<
21136  * if inc:
21137  * Py_INCREF((<PyObject **> data)[0])
21138  */
21139  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
21140  if (__pyx_t_4) {
21141 
21142  /* "View.MemoryView":1383
21143  * for i in range(shape[0]):
21144  * if ndim == 1:
21145  * if inc: # <<<<<<<<<<<<<<
21146  * Py_INCREF((<PyObject **> data)[0])
21147  * else:
21148  */
21149  __pyx_t_4 = (__pyx_v_inc != 0);
21150  if (__pyx_t_4) {
21151 
21152  /* "View.MemoryView":1384
21153  * if ndim == 1:
21154  * if inc:
21155  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
21156  * else:
21157  * Py_DECREF((<PyObject **> data)[0])
21158  */
21159  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
21160 
21161  /* "View.MemoryView":1383
21162  * for i in range(shape[0]):
21163  * if ndim == 1:
21164  * if inc: # <<<<<<<<<<<<<<
21165  * Py_INCREF((<PyObject **> data)[0])
21166  * else:
21167  */
21168  goto __pyx_L6;
21169  }
21170 
21171  /* "View.MemoryView":1386
21172  * Py_INCREF((<PyObject **> data)[0])
21173  * else:
21174  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
21175  * else:
21176  * refcount_objects_in_slice(data, shape + 1, strides + 1,
21177  */
21178  /*else*/ {
21179  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
21180  }
21181  __pyx_L6:;
21182 
21183  /* "View.MemoryView":1382
21184  *
21185  * for i in range(shape[0]):
21186  * if ndim == 1: # <<<<<<<<<<<<<<
21187  * if inc:
21188  * Py_INCREF((<PyObject **> data)[0])
21189  */
21190  goto __pyx_L5;
21191  }
21192 
21193  /* "View.MemoryView":1388
21194  * Py_DECREF((<PyObject **> data)[0])
21195  * else:
21196  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
21197  * ndim - 1, inc)
21198  *
21199  */
21200  /*else*/ {
21201 
21202  /* "View.MemoryView":1389
21203  * else:
21204  * refcount_objects_in_slice(data, shape + 1, strides + 1,
21205  * ndim - 1, inc) # <<<<<<<<<<<<<<
21206  *
21207  * data += strides[0]
21208  */
21209  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
21210  }
21211  __pyx_L5:;
21212 
21213  /* "View.MemoryView":1391
21214  * ndim - 1, inc)
21215  *
21216  * data += strides[0] # <<<<<<<<<<<<<<
21217  *
21218  *
21219  */
21220  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
21221  }
21222 
21223  /* "View.MemoryView":1377
21224  *
21225  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21226  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21227  * Py_ssize_t *strides, int ndim, bint inc):
21228  * cdef Py_ssize_t i
21229  */
21230 
21231  /* function exit code */
21232  __Pyx_RefNannyFinishContext();
21233 }
21234 
21235 /* "View.MemoryView":1397
21236  *
21237  * @cname('__pyx_memoryview_slice_assign_scalar')
21238  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21239  * size_t itemsize, void *item,
21240  * bint dtype_is_object) nogil:
21241  */
21242 
21243 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
21244 
21245  /* "View.MemoryView":1400
21246  * size_t itemsize, void *item,
21247  * bint dtype_is_object) nogil:
21248  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
21249  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21250  * itemsize, item)
21251  */
21252  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21253 
21254  /* "View.MemoryView":1401
21255  * bint dtype_is_object) nogil:
21256  * refcount_copying(dst, dtype_is_object, ndim, False)
21257  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
21258  * itemsize, item)
21259  * refcount_copying(dst, dtype_is_object, ndim, True)
21260  */
21261  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
21262 
21263  /* "View.MemoryView":1403
21264  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21265  * itemsize, item)
21266  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
21267  *
21268  *
21269  */
21270  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21271 
21272  /* "View.MemoryView":1397
21273  *
21274  * @cname('__pyx_memoryview_slice_assign_scalar')
21275  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21276  * size_t itemsize, void *item,
21277  * bint dtype_is_object) nogil:
21278  */
21279 
21280  /* function exit code */
21281 }
21282 
21283 /* "View.MemoryView":1407
21284  *
21285  * @cname('__pyx_memoryview__slice_assign_scalar')
21286  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21287  * Py_ssize_t *strides, int ndim,
21288  * size_t itemsize, void *item) nogil:
21289  */
21290 
21291 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
21292  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21293  Py_ssize_t __pyx_v_stride;
21294  Py_ssize_t __pyx_v_extent;
21295  int __pyx_t_1;
21296  Py_ssize_t __pyx_t_2;
21297  Py_ssize_t __pyx_t_3;
21298  Py_ssize_t __pyx_t_4;
21299 
21300  /* "View.MemoryView":1411
21301  * size_t itemsize, void *item) nogil:
21302  * cdef Py_ssize_t i
21303  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
21304  * cdef Py_ssize_t extent = shape[0]
21305  *
21306  */
21307  __pyx_v_stride = (__pyx_v_strides[0]);
21308 
21309  /* "View.MemoryView":1412
21310  * cdef Py_ssize_t i
21311  * cdef Py_ssize_t stride = strides[0]
21312  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
21313  *
21314  * if ndim == 1:
21315  */
21316  __pyx_v_extent = (__pyx_v_shape[0]);
21317 
21318  /* "View.MemoryView":1414
21319  * cdef Py_ssize_t extent = shape[0]
21320  *
21321  * if ndim == 1: # <<<<<<<<<<<<<<
21322  * for i in range(extent):
21323  * memcpy(data, item, itemsize)
21324  */
21325  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21326  if (__pyx_t_1) {
21327 
21328  /* "View.MemoryView":1415
21329  *
21330  * if ndim == 1:
21331  * for i in range(extent): # <<<<<<<<<<<<<<
21332  * memcpy(data, item, itemsize)
21333  * data += stride
21334  */
21335  __pyx_t_2 = __pyx_v_extent;
21336  __pyx_t_3 = __pyx_t_2;
21337  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21338  __pyx_v_i = __pyx_t_4;
21339 
21340  /* "View.MemoryView":1416
21341  * if ndim == 1:
21342  * for i in range(extent):
21343  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
21344  * data += stride
21345  * else:
21346  */
21347  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
21348 
21349  /* "View.MemoryView":1417
21350  * for i in range(extent):
21351  * memcpy(data, item, itemsize)
21352  * data += stride # <<<<<<<<<<<<<<
21353  * else:
21354  * for i in range(extent):
21355  */
21356  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21357  }
21358 
21359  /* "View.MemoryView":1414
21360  * cdef Py_ssize_t extent = shape[0]
21361  *
21362  * if ndim == 1: # <<<<<<<<<<<<<<
21363  * for i in range(extent):
21364  * memcpy(data, item, itemsize)
21365  */
21366  goto __pyx_L3;
21367  }
21368 
21369  /* "View.MemoryView":1419
21370  * data += stride
21371  * else:
21372  * for i in range(extent): # <<<<<<<<<<<<<<
21373  * _slice_assign_scalar(data, shape + 1, strides + 1,
21374  * ndim - 1, itemsize, item)
21375  */
21376  /*else*/ {
21377  __pyx_t_2 = __pyx_v_extent;
21378  __pyx_t_3 = __pyx_t_2;
21379  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21380  __pyx_v_i = __pyx_t_4;
21381 
21382  /* "View.MemoryView":1420
21383  * else:
21384  * for i in range(extent):
21385  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
21386  * ndim - 1, itemsize, item)
21387  * data += stride
21388  */
21389  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
21390 
21391  /* "View.MemoryView":1422
21392  * _slice_assign_scalar(data, shape + 1, strides + 1,
21393  * ndim - 1, itemsize, item)
21394  * data += stride # <<<<<<<<<<<<<<
21395  *
21396  *
21397  */
21398  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21399  }
21400  }
21401  __pyx_L3:;
21402 
21403  /* "View.MemoryView":1407
21404  *
21405  * @cname('__pyx_memoryview__slice_assign_scalar')
21406  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21407  * Py_ssize_t *strides, int ndim,
21408  * size_t itemsize, void *item) nogil:
21409  */
21410 
21411  /* function exit code */
21412 }
21413 
21414 /* "(tree fragment)":1
21415  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21416  * cdef object __pyx_PickleError
21417  * cdef object __pyx_result
21418  */
21419 
21420 /* Python wrapper */
21421 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
21422 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
21423 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21424  PyObject *__pyx_v___pyx_type = 0;
21425  long __pyx_v___pyx_checksum;
21426  PyObject *__pyx_v___pyx_state = 0;
21427  PyObject *__pyx_r = 0;
21428  __Pyx_RefNannyDeclarations
21429  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
21430  {
21431  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21432  PyObject* values[3] = {0,0,0};
21433  if (unlikely(__pyx_kwds)) {
21434  Py_ssize_t kw_args;
21435  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21436  switch (pos_args) {
21437  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21438  CYTHON_FALLTHROUGH;
21439  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21440  CYTHON_FALLTHROUGH;
21441  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21442  CYTHON_FALLTHROUGH;
21443  case 0: break;
21444  default: goto __pyx_L5_argtuple_error;
21445  }
21446  kw_args = PyDict_Size(__pyx_kwds);
21447  switch (pos_args) {
21448  case 0:
21449  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21450  else goto __pyx_L5_argtuple_error;
21451  CYTHON_FALLTHROUGH;
21452  case 1:
21453  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21454  else {
21455  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
21456  }
21457  CYTHON_FALLTHROUGH;
21458  case 2:
21459  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21460  else {
21461  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
21462  }
21463  }
21464  if (unlikely(kw_args > 0)) {
21465  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
21466  }
21467  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21468  goto __pyx_L5_argtuple_error;
21469  } else {
21470  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21471  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21472  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21473  }
21474  __pyx_v___pyx_type = values[0];
21475  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
21476  __pyx_v___pyx_state = values[2];
21477  }
21478  goto __pyx_L4_argument_unpacking_done;
21479  __pyx_L5_argtuple_error:;
21480  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
21481  __pyx_L3_error:;
21482  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21483  __Pyx_RefNannyFinishContext();
21484  return NULL;
21485  __pyx_L4_argument_unpacking_done:;
21486  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21487 
21488  /* function exit code */
21489  __Pyx_RefNannyFinishContext();
21490  return __pyx_r;
21491 }
21492 
21493 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
21494  PyObject *__pyx_v___pyx_PickleError = 0;
21495  PyObject *__pyx_v___pyx_result = 0;
21496  PyObject *__pyx_r = NULL;
21497  __Pyx_RefNannyDeclarations
21498  int __pyx_t_1;
21499  PyObject *__pyx_t_2 = NULL;
21500  PyObject *__pyx_t_3 = NULL;
21501  PyObject *__pyx_t_4 = NULL;
21502  PyObject *__pyx_t_5 = NULL;
21503  int __pyx_t_6;
21504  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
21505 
21506  /* "(tree fragment)":4
21507  * cdef object __pyx_PickleError
21508  * cdef object __pyx_result
21509  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21510  * from pickle import PickleError as __pyx_PickleError
21511  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21512  */
21513  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
21514  if (__pyx_t_1) {
21515 
21516  /* "(tree fragment)":5
21517  * cdef object __pyx_result
21518  * if __pyx_checksum != 0xb068931:
21519  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
21520  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21521  * __pyx_result = Enum.__new__(__pyx_type)
21522  */
21523  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
21524  __Pyx_GOTREF(__pyx_t_2);
21525  __Pyx_INCREF(__pyx_n_s_PickleError);
21526  __Pyx_GIVEREF(__pyx_n_s_PickleError);
21527  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
21528  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
21529  __Pyx_GOTREF(__pyx_t_3);
21530  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21531  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
21532  __Pyx_GOTREF(__pyx_t_2);
21533  __Pyx_INCREF(__pyx_t_2);
21534  __pyx_v___pyx_PickleError = __pyx_t_2;
21535  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21536  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21537 
21538  /* "(tree fragment)":6
21539  * if __pyx_checksum != 0xb068931:
21540  * from pickle import PickleError as __pyx_PickleError
21541  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
21542  * __pyx_result = Enum.__new__(__pyx_type)
21543  * if __pyx_state is not None:
21544  */
21545  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
21546  __Pyx_GOTREF(__pyx_t_2);
21547  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
21548  __Pyx_GOTREF(__pyx_t_4);
21549  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21550  __Pyx_INCREF(__pyx_v___pyx_PickleError);
21551  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
21552  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21553  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
21554  if (likely(__pyx_t_5)) {
21555  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21556  __Pyx_INCREF(__pyx_t_5);
21557  __Pyx_INCREF(function);
21558  __Pyx_DECREF_SET(__pyx_t_2, function);
21559  }
21560  }
21561  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
21562  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21563  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21564  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
21565  __Pyx_GOTREF(__pyx_t_3);
21566  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21567  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21568  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21569  __PYX_ERR(2, 6, __pyx_L1_error)
21570 
21571  /* "(tree fragment)":4
21572  * cdef object __pyx_PickleError
21573  * cdef object __pyx_result
21574  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21575  * from pickle import PickleError as __pyx_PickleError
21576  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21577  */
21578  }
21579 
21580  /* "(tree fragment)":7
21581  * from pickle import PickleError as __pyx_PickleError
21582  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21583  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
21584  * if __pyx_state is not None:
21585  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21586  */
21587  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
21588  __Pyx_GOTREF(__pyx_t_2);
21589  __pyx_t_4 = NULL;
21590  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21591  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21592  if (likely(__pyx_t_4)) {
21593  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21594  __Pyx_INCREF(__pyx_t_4);
21595  __Pyx_INCREF(function);
21596  __Pyx_DECREF_SET(__pyx_t_2, function);
21597  }
21598  }
21599  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
21600  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21601  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
21602  __Pyx_GOTREF(__pyx_t_3);
21603  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21604  __pyx_v___pyx_result = __pyx_t_3;
21605  __pyx_t_3 = 0;
21606 
21607  /* "(tree fragment)":8
21608  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21609  * __pyx_result = Enum.__new__(__pyx_type)
21610  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21611  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21612  * return __pyx_result
21613  */
21614  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21615  __pyx_t_6 = (__pyx_t_1 != 0);
21616  if (__pyx_t_6) {
21617 
21618  /* "(tree fragment)":9
21619  * __pyx_result = Enum.__new__(__pyx_type)
21620  * if __pyx_state is not None:
21621  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
21622  * return __pyx_result
21623  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21624  */
21625  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
21626  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
21627  __Pyx_GOTREF(__pyx_t_3);
21628  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21629 
21630  /* "(tree fragment)":8
21631  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21632  * __pyx_result = Enum.__new__(__pyx_type)
21633  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21634  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21635  * return __pyx_result
21636  */
21637  }
21638 
21639  /* "(tree fragment)":10
21640  * if __pyx_state is not None:
21641  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21642  * return __pyx_result # <<<<<<<<<<<<<<
21643  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21644  * __pyx_result.name = __pyx_state[0]
21645  */
21646  __Pyx_XDECREF(__pyx_r);
21647  __Pyx_INCREF(__pyx_v___pyx_result);
21648  __pyx_r = __pyx_v___pyx_result;
21649  goto __pyx_L0;
21650 
21651  /* "(tree fragment)":1
21652  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21653  * cdef object __pyx_PickleError
21654  * cdef object __pyx_result
21655  */
21656 
21657  /* function exit code */
21658  __pyx_L1_error:;
21659  __Pyx_XDECREF(__pyx_t_2);
21660  __Pyx_XDECREF(__pyx_t_3);
21661  __Pyx_XDECREF(__pyx_t_4);
21662  __Pyx_XDECREF(__pyx_t_5);
21663  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21664  __pyx_r = NULL;
21665  __pyx_L0:;
21666  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21667  __Pyx_XDECREF(__pyx_v___pyx_result);
21668  __Pyx_XGIVEREF(__pyx_r);
21669  __Pyx_RefNannyFinishContext();
21670  return __pyx_r;
21671 }
21672 
21673 /* "(tree fragment)":11
21674  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21675  * return __pyx_result
21676  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21677  * __pyx_result.name = __pyx_state[0]
21678  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21679  */
21680 
21681 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21682  PyObject *__pyx_r = NULL;
21683  __Pyx_RefNannyDeclarations
21684  PyObject *__pyx_t_1 = NULL;
21685  int __pyx_t_2;
21686  Py_ssize_t __pyx_t_3;
21687  int __pyx_t_4;
21688  int __pyx_t_5;
21689  PyObject *__pyx_t_6 = NULL;
21690  PyObject *__pyx_t_7 = NULL;
21691  PyObject *__pyx_t_8 = NULL;
21692  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21693 
21694  /* "(tree fragment)":12
21695  * return __pyx_result
21696  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21697  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21698  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21699  * __pyx_result.__dict__.update(__pyx_state[1])
21700  */
21701  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21702  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21703  __PYX_ERR(2, 12, __pyx_L1_error)
21704  }
21705  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
21706  __Pyx_GOTREF(__pyx_t_1);
21707  __Pyx_GIVEREF(__pyx_t_1);
21708  __Pyx_GOTREF(__pyx_v___pyx_result->name);
21709  __Pyx_DECREF(__pyx_v___pyx_result->name);
21710  __pyx_v___pyx_result->name = __pyx_t_1;
21711  __pyx_t_1 = 0;
21712 
21713  /* "(tree fragment)":13
21714  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21715  * __pyx_result.name = __pyx_state[0]
21716  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21717  * __pyx_result.__dict__.update(__pyx_state[1])
21718  */
21719  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21720  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21721  __PYX_ERR(2, 13, __pyx_L1_error)
21722  }
21723  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
21724  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21725  if (__pyx_t_4) {
21726  } else {
21727  __pyx_t_2 = __pyx_t_4;
21728  goto __pyx_L4_bool_binop_done;
21729  }
21730  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
21731  __pyx_t_5 = (__pyx_t_4 != 0);
21732  __pyx_t_2 = __pyx_t_5;
21733  __pyx_L4_bool_binop_done:;
21734  if (__pyx_t_2) {
21735 
21736  /* "(tree fragment)":14
21737  * __pyx_result.name = __pyx_state[0]
21738  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21739  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21740  */
21741  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
21742  __Pyx_GOTREF(__pyx_t_6);
21743  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
21744  __Pyx_GOTREF(__pyx_t_7);
21745  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21746  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21747  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21748  __PYX_ERR(2, 14, __pyx_L1_error)
21749  }
21750  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
21751  __Pyx_GOTREF(__pyx_t_6);
21752  __pyx_t_8 = NULL;
21753  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21754  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21755  if (likely(__pyx_t_8)) {
21756  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21757  __Pyx_INCREF(__pyx_t_8);
21758  __Pyx_INCREF(function);
21759  __Pyx_DECREF_SET(__pyx_t_7, function);
21760  }
21761  }
21762  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21763  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21764  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21765  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
21766  __Pyx_GOTREF(__pyx_t_1);
21767  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21768  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21769 
21770  /* "(tree fragment)":13
21771  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21772  * __pyx_result.name = __pyx_state[0]
21773  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21774  * __pyx_result.__dict__.update(__pyx_state[1])
21775  */
21776  }
21777 
21778  /* "(tree fragment)":11
21779  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21780  * return __pyx_result
21781  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21782  * __pyx_result.name = __pyx_state[0]
21783  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21784  */
21785 
21786  /* function exit code */
21787  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21788  goto __pyx_L0;
21789  __pyx_L1_error:;
21790  __Pyx_XDECREF(__pyx_t_1);
21791  __Pyx_XDECREF(__pyx_t_6);
21792  __Pyx_XDECREF(__pyx_t_7);
21793  __Pyx_XDECREF(__pyx_t_8);
21794  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21795  __pyx_r = 0;
21796  __pyx_L0:;
21797  __Pyx_XGIVEREF(__pyx_r);
21798  __Pyx_RefNannyFinishContext();
21799  return __pyx_r;
21800 }
21801 
21802 /* "BufferFormatFromTypeInfo":1463
21803  *
21804  * @cname('__pyx_format_from_typeinfo')
21805  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
21806  * cdef __Pyx_StructField *field
21807  * cdef __pyx_typeinfo_string fmt
21808  */
21809 
21810 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
21811  __Pyx_StructField *__pyx_v_field;
21812  struct __pyx_typeinfo_string __pyx_v_fmt;
21813  PyObject *__pyx_v_part = 0;
21814  PyObject *__pyx_v_result = 0;
21815  PyObject *__pyx_v_alignment = NULL;
21816  PyObject *__pyx_v_parts = NULL;
21817  PyObject *__pyx_v_extents = NULL;
21818  int __pyx_v_i;
21819  PyObject *__pyx_r = NULL;
21820  __Pyx_RefNannyDeclarations
21821  int __pyx_t_1;
21822  int __pyx_t_2;
21823  PyObject *__pyx_t_3 = NULL;
21824  __Pyx_StructField *__pyx_t_4;
21825  PyObject *__pyx_t_5 = NULL;
21826  PyObject *__pyx_t_6 = NULL;
21827  int __pyx_t_7;
21828  int __pyx_t_8;
21829  int __pyx_t_9;
21830  int __pyx_t_10;
21831  __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
21832 
21833  /* "BufferFormatFromTypeInfo":1468
21834  * cdef bytes part, result
21835  *
21836  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
21837  * assert type.fields != NULL and type.fields.type != NULL
21838  *
21839  */
21840  __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0);
21841  if (__pyx_t_1) {
21842 
21843  /* "BufferFormatFromTypeInfo":1469
21844  *
21845  * if type.typegroup == 'S':
21846  * assert type.fields != NULL and type.fields.type != NULL # <<<<<<<<<<<<<<
21847  *
21848  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
21849  */
21850  #ifndef CYTHON_WITHOUT_ASSERTIONS
21851  if (unlikely(!Py_OptimizeFlag)) {
21852  __pyx_t_2 = ((__pyx_v_type->fields != NULL) != 0);
21853  if (__pyx_t_2) {
21854  } else {
21855  __pyx_t_1 = __pyx_t_2;
21856  goto __pyx_L4_bool_binop_done;
21857  }
21858  __pyx_t_2 = ((__pyx_v_type->fields->type != NULL) != 0);
21859  __pyx_t_1 = __pyx_t_2;
21860  __pyx_L4_bool_binop_done:;
21861  if (unlikely(!__pyx_t_1)) {
21862  PyErr_SetNone(PyExc_AssertionError);
21863  __PYX_ERR(2, 1469, __pyx_L1_error)
21864  }
21865  }
21866  #endif
21867 
21868  /* "BufferFormatFromTypeInfo":1471
21869  * assert type.fields != NULL and type.fields.type != NULL
21870  *
21871  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
21872  * alignment = b'^'
21873  * else:
21874  */
21875  __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
21876  if (__pyx_t_1) {
21877 
21878  /* "BufferFormatFromTypeInfo":1472
21879  *
21880  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
21881  * alignment = b'^' # <<<<<<<<<<<<<<
21882  * else:
21883  * alignment = b''
21884  */
21885  __Pyx_INCREF(__pyx_kp_b__26);
21886  __pyx_v_alignment = __pyx_kp_b__26;
21887 
21888  /* "BufferFormatFromTypeInfo":1471
21889  * assert type.fields != NULL and type.fields.type != NULL
21890  *
21891  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
21892  * alignment = b'^'
21893  * else:
21894  */
21895  goto __pyx_L6;
21896  }
21897 
21898  /* "BufferFormatFromTypeInfo":1474
21899  * alignment = b'^'
21900  * else:
21901  * alignment = b'' # <<<<<<<<<<<<<<
21902  *
21903  * parts = [b"T{"]
21904  */
21905  /*else*/ {
21906  __Pyx_INCREF(__pyx_kp_b__27);
21907  __pyx_v_alignment = __pyx_kp_b__27;
21908  }
21909  __pyx_L6:;
21910 
21911  /* "BufferFormatFromTypeInfo":1476
21912  * alignment = b''
21913  *
21914  * parts = [b"T{"] # <<<<<<<<<<<<<<
21915  * field = type.fields
21916  *
21917  */
21918  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1476, __pyx_L1_error)
21919  __Pyx_GOTREF(__pyx_t_3);
21920  __Pyx_INCREF(__pyx_kp_b_T);
21921  __Pyx_GIVEREF(__pyx_kp_b_T);
21922  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_b_T);
21923  __pyx_v_parts = ((PyObject*)__pyx_t_3);
21924  __pyx_t_3 = 0;
21925 
21926  /* "BufferFormatFromTypeInfo":1477
21927  *
21928  * parts = [b"T{"]
21929  * field = type.fields # <<<<<<<<<<<<<<
21930  *
21931  * while field.type:
21932  */
21933  __pyx_t_4 = __pyx_v_type->fields;
21934  __pyx_v_field = __pyx_t_4;
21935 
21936  /* "BufferFormatFromTypeInfo":1479
21937  * field = type.fields
21938  *
21939  * while field.type: # <<<<<<<<<<<<<<
21940  * part = format_from_typeinfo(field.type)
21941  * parts.append(part + b':' + field.name + b':')
21942  */
21943  while (1) {
21944  __pyx_t_1 = (__pyx_v_field->type != 0);
21945  if (!__pyx_t_1) break;
21946 
21947  /* "BufferFormatFromTypeInfo":1480
21948  *
21949  * while field.type:
21950  * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<<
21951  * parts.append(part + b':' + field.name + b':')
21952  * field += 1
21953  */
21954  __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1480, __pyx_L1_error)
21955  __Pyx_GOTREF(__pyx_t_3);
21956  __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_3));
21957  __pyx_t_3 = 0;
21958 
21959  /* "BufferFormatFromTypeInfo":1481
21960  * while field.type:
21961  * part = format_from_typeinfo(field.type)
21962  * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<<
21963  * field += 1
21964  *
21965  */
21966  __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__28); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1481, __pyx_L1_error)
21967  __Pyx_GOTREF(__pyx_t_3);
21968  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1481, __pyx_L1_error)
21969  __Pyx_GOTREF(__pyx_t_5);
21970  __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1481, __pyx_L1_error)
21971  __Pyx_GOTREF(__pyx_t_6);
21972  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21973  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21974  __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__28); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1481, __pyx_L1_error)
21975  __Pyx_GOTREF(__pyx_t_5);
21976  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21977  __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 1481, __pyx_L1_error)
21978  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21979 
21980  /* "BufferFormatFromTypeInfo":1482
21981  * part = format_from_typeinfo(field.type)
21982  * parts.append(part + b':' + field.name + b':')
21983  * field += 1 # <<<<<<<<<<<<<<
21984  *
21985  * result = alignment.join(parts) + b'}'
21986  */
21987  __pyx_v_field = (__pyx_v_field + 1);
21988  }
21989 
21990  /* "BufferFormatFromTypeInfo":1484
21991  * field += 1
21992  *
21993  * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<<
21994  * else:
21995  * fmt = __Pyx_TypeInfoToFormat(type)
21996  */
21997  __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1484, __pyx_L1_error)
21998  __Pyx_GOTREF(__pyx_t_5);
21999  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__29); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1484, __pyx_L1_error)
22000  __Pyx_GOTREF(__pyx_t_6);
22001  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22002  if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(2, 1484, __pyx_L1_error)
22003  __pyx_v_result = ((PyObject*)__pyx_t_6);
22004  __pyx_t_6 = 0;
22005 
22006  /* "BufferFormatFromTypeInfo":1468
22007  * cdef bytes part, result
22008  *
22009  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
22010  * assert type.fields != NULL and type.fields.type != NULL
22011  *
22012  */
22013  goto __pyx_L3;
22014  }
22015 
22016  /* "BufferFormatFromTypeInfo":1486
22017  * result = alignment.join(parts) + b'}'
22018  * else:
22019  * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<<
22020  * if type.arraysize[0]:
22021  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
22022  */
22023  /*else*/ {
22024  __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
22025 
22026  /* "BufferFormatFromTypeInfo":1487
22027  * else:
22028  * fmt = __Pyx_TypeInfoToFormat(type)
22029  * if type.arraysize[0]: # <<<<<<<<<<<<<<
22030  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
22031  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
22032  */
22033  __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
22034  if (__pyx_t_1) {
22035 
22036  /* "BufferFormatFromTypeInfo":1488
22037  * fmt = __Pyx_TypeInfoToFormat(type)
22038  * if type.arraysize[0]:
22039  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] # <<<<<<<<<<<<<<
22040  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
22041  * else:
22042  */
22043  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1488, __pyx_L1_error)
22044  __Pyx_GOTREF(__pyx_t_6);
22045  __pyx_t_8 = __pyx_v_type->ndim;
22046  __pyx_t_9 = __pyx_t_8;
22047  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
22048  __pyx_v_i = __pyx_t_10;
22049  __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1488, __pyx_L1_error)
22050  __Pyx_GOTREF(__pyx_t_5);
22051  __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1488, __pyx_L1_error)
22052  __Pyx_GOTREF(__pyx_t_3);
22053  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22054  if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(2, 1488, __pyx_L1_error)
22055  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22056  }
22057  __pyx_v_extents = ((PyObject*)__pyx_t_6);
22058  __pyx_t_6 = 0;
22059 
22060  /* "BufferFormatFromTypeInfo":1489
22061  * if type.arraysize[0]:
22062  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
22063  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string # <<<<<<<<<<<<<<
22064  * else:
22065  * result = fmt.string
22066  */
22067  __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__30, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1489, __pyx_L1_error)
22068  __Pyx_GOTREF(__pyx_t_6);
22069  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1489, __pyx_L1_error)
22070  __Pyx_GOTREF(__pyx_t_3);
22071  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22072  __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1489, __pyx_L1_error)
22073  __Pyx_GOTREF(__pyx_t_6);
22074  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22075  __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1489, __pyx_L1_error)
22076  __Pyx_GOTREF(__pyx_t_3);
22077  __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1489, __pyx_L1_error)
22078  __Pyx_GOTREF(__pyx_t_5);
22079  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22080  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22081  if (!(likely(PyBytes_CheckExact(__pyx_t_5))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(2, 1489, __pyx_L1_error)
22082  __pyx_v_result = ((PyObject*)__pyx_t_5);
22083  __pyx_t_5 = 0;
22084 
22085  /* "BufferFormatFromTypeInfo":1487
22086  * else:
22087  * fmt = __Pyx_TypeInfoToFormat(type)
22088  * if type.arraysize[0]: # <<<<<<<<<<<<<<
22089  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
22090  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
22091  */
22092  goto __pyx_L9;
22093  }
22094 
22095  /* "BufferFormatFromTypeInfo":1491
22096  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
22097  * else:
22098  * result = fmt.string # <<<<<<<<<<<<<<
22099  *
22100  * return result
22101  */
22102  /*else*/ {
22103  __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1491, __pyx_L1_error)
22104  __Pyx_GOTREF(__pyx_t_5);
22105  __pyx_v_result = ((PyObject*)__pyx_t_5);
22106  __pyx_t_5 = 0;
22107  }
22108  __pyx_L9:;
22109  }
22110  __pyx_L3:;
22111 
22112  /* "BufferFormatFromTypeInfo":1493
22113  * result = fmt.string
22114  *
22115  * return result # <<<<<<<<<<<<<<
22116  */
22117  __Pyx_XDECREF(__pyx_r);
22118  __Pyx_INCREF(__pyx_v_result);
22119  __pyx_r = __pyx_v_result;
22120  goto __pyx_L0;
22121 
22122  /* "BufferFormatFromTypeInfo":1463
22123  *
22124  * @cname('__pyx_format_from_typeinfo')
22125  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
22126  * cdef __Pyx_StructField *field
22127  * cdef __pyx_typeinfo_string fmt
22128  */
22129 
22130  /* function exit code */
22131  __pyx_L1_error:;
22132  __Pyx_XDECREF(__pyx_t_3);
22133  __Pyx_XDECREF(__pyx_t_5);
22134  __Pyx_XDECREF(__pyx_t_6);
22135  __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
22136  __pyx_r = 0;
22137  __pyx_L0:;
22138  __Pyx_XDECREF(__pyx_v_part);
22139  __Pyx_XDECREF(__pyx_v_result);
22140  __Pyx_XDECREF(__pyx_v_alignment);
22141  __Pyx_XDECREF(__pyx_v_parts);
22142  __Pyx_XDECREF(__pyx_v_extents);
22143  __Pyx_XGIVEREF(__pyx_r);
22144  __Pyx_RefNannyFinishContext();
22145  return __pyx_r;
22146 }
22147 static struct __pyx_vtabstruct_array __pyx_vtable_array;
22148 
22149 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
22150  struct __pyx_array_obj *p;
22151  PyObject *o;
22152  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22153  o = (*t->tp_alloc)(t, 0);
22154  } else {
22155  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22156  }
22157  if (unlikely(!o)) return 0;
22158  p = ((struct __pyx_array_obj *)o);
22159  p->__pyx_vtab = __pyx_vtabptr_array;
22160  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
22161  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
22162  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
22163  return o;
22164  bad:
22165  Py_DECREF(o); o = 0;
22166  return NULL;
22167 }
22168 
22169 static void __pyx_tp_dealloc_array(PyObject *o) {
22170  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
22171  #if CYTHON_USE_TP_FINALIZE
22172  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22173  if (PyObject_CallFinalizerFromDealloc(o)) return;
22174  }
22175  #endif
22176  {
22177  PyObject *etype, *eval, *etb;
22178  PyErr_Fetch(&etype, &eval, &etb);
22179  ++Py_REFCNT(o);
22180  __pyx_array___dealloc__(o);
22181  --Py_REFCNT(o);
22182  PyErr_Restore(etype, eval, etb);
22183  }
22184  Py_CLEAR(p->mode);
22185  Py_CLEAR(p->_format);
22186  (*Py_TYPE(o)->tp_free)(o);
22187 }
22188 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
22189  PyObject *r;
22190  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22191  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22192  Py_DECREF(x);
22193  return r;
22194 }
22195 
22196 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
22197  if (v) {
22198  return __pyx_array___setitem__(o, i, v);
22199  }
22200  else {
22201  PyErr_Format(PyExc_NotImplementedError,
22202  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22203  return -1;
22204  }
22205 }
22206 
22207 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
22208  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
22209  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22210  PyErr_Clear();
22211  v = __pyx_array___getattr__(o, n);
22212  }
22213  return v;
22214 }
22215 
22216 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
22217  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
22218 }
22219 
22220 static PyMethodDef __pyx_methods_array[] = {
22221  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
22222  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
22223  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
22224  {0, 0, 0, 0}
22225 };
22226 
22227 static struct PyGetSetDef __pyx_getsets_array[] = {
22228  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
22229  {0, 0, 0, 0, 0}
22230 };
22231 
22232 static PySequenceMethods __pyx_tp_as_sequence_array = {
22233  __pyx_array___len__, /*sq_length*/
22234  0, /*sq_concat*/
22235  0, /*sq_repeat*/
22236  __pyx_sq_item_array, /*sq_item*/
22237  0, /*sq_slice*/
22238  0, /*sq_ass_item*/
22239  0, /*sq_ass_slice*/
22240  0, /*sq_contains*/
22241  0, /*sq_inplace_concat*/
22242  0, /*sq_inplace_repeat*/
22243 };
22244 
22245 static PyMappingMethods __pyx_tp_as_mapping_array = {
22246  __pyx_array___len__, /*mp_length*/
22247  __pyx_array___getitem__, /*mp_subscript*/
22248  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
22249 };
22250 
22251 static PyBufferProcs __pyx_tp_as_buffer_array = {
22252  #if PY_MAJOR_VERSION < 3
22253  0, /*bf_getreadbuffer*/
22254  #endif
22255  #if PY_MAJOR_VERSION < 3
22256  0, /*bf_getwritebuffer*/
22257  #endif
22258  #if PY_MAJOR_VERSION < 3
22259  0, /*bf_getsegcount*/
22260  #endif
22261  #if PY_MAJOR_VERSION < 3
22262  0, /*bf_getcharbuffer*/
22263  #endif
22264  __pyx_array_getbuffer, /*bf_getbuffer*/
22265  0, /*bf_releasebuffer*/
22266 };
22267 
22268 static PyTypeObject __pyx_type___pyx_array = {
22269  PyVarObject_HEAD_INIT(0, 0)
22270  "cpartitioning.array", /*tp_name*/
22271  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
22272  0, /*tp_itemsize*/
22273  __pyx_tp_dealloc_array, /*tp_dealloc*/
22274  #if PY_VERSION_HEX < 0x030800b4
22275  0, /*tp_print*/
22276  #endif
22277  #if PY_VERSION_HEX >= 0x030800b4
22278  0, /*tp_vectorcall_offset*/
22279  #endif
22280  0, /*tp_getattr*/
22281  0, /*tp_setattr*/
22282  #if PY_MAJOR_VERSION < 3
22283  0, /*tp_compare*/
22284  #endif
22285  #if PY_MAJOR_VERSION >= 3
22286  0, /*tp_as_async*/
22287  #endif
22288  0, /*tp_repr*/
22289  0, /*tp_as_number*/
22290  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
22291  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
22292  0, /*tp_hash*/
22293  0, /*tp_call*/
22294  0, /*tp_str*/
22295  __pyx_tp_getattro_array, /*tp_getattro*/
22296  0, /*tp_setattro*/
22297  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
22298  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
22299  0, /*tp_doc*/
22300  0, /*tp_traverse*/
22301  0, /*tp_clear*/
22302  0, /*tp_richcompare*/
22303  0, /*tp_weaklistoffset*/
22304  0, /*tp_iter*/
22305  0, /*tp_iternext*/
22306  __pyx_methods_array, /*tp_methods*/
22307  0, /*tp_members*/
22308  __pyx_getsets_array, /*tp_getset*/
22309  0, /*tp_base*/
22310  0, /*tp_dict*/
22311  0, /*tp_descr_get*/
22312  0, /*tp_descr_set*/
22313  0, /*tp_dictoffset*/
22314  0, /*tp_init*/
22315  0, /*tp_alloc*/
22316  __pyx_tp_new_array, /*tp_new*/
22317  0, /*tp_free*/
22318  0, /*tp_is_gc*/
22319  0, /*tp_bases*/
22320  0, /*tp_mro*/
22321  0, /*tp_cache*/
22322  0, /*tp_subclasses*/
22323  0, /*tp_weaklist*/
22324  0, /*tp_del*/
22325  0, /*tp_version_tag*/
22326  #if PY_VERSION_HEX >= 0x030400a1
22327  0, /*tp_finalize*/
22328  #endif
22329  #if PY_VERSION_HEX >= 0x030800b1
22330  0, /*tp_vectorcall*/
22331  #endif
22332  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22333  0, /*tp_print*/
22334  #endif
22335 };
22336 
22337 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22338  struct __pyx_MemviewEnum_obj *p;
22339  PyObject *o;
22340  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22341  o = (*t->tp_alloc)(t, 0);
22342  } else {
22343  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22344  }
22345  if (unlikely(!o)) return 0;
22346  p = ((struct __pyx_MemviewEnum_obj *)o);
22347  p->name = Py_None; Py_INCREF(Py_None);
22348  return o;
22349 }
22350 
22351 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22352  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22353  #if CYTHON_USE_TP_FINALIZE
22354  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22355  if (PyObject_CallFinalizerFromDealloc(o)) return;
22356  }
22357  #endif
22358  PyObject_GC_UnTrack(o);
22359  Py_CLEAR(p->name);
22360  (*Py_TYPE(o)->tp_free)(o);
22361 }
22362 
22363 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
22364  int e;
22365  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22366  if (p->name) {
22367  e = (*v)(p->name, a); if (e) return e;
22368  }
22369  return 0;
22370 }
22371 
22372 static int __pyx_tp_clear_Enum(PyObject *o) {
22373  PyObject* tmp;
22374  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22375  tmp = ((PyObject*)p->name);
22376  p->name = Py_None; Py_INCREF(Py_None);
22377  Py_XDECREF(tmp);
22378  return 0;
22379 }
22380 
22381 static PyMethodDef __pyx_methods_Enum[] = {
22382  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22383  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22384  {0, 0, 0, 0}
22385 };
22386 
22387 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22388  PyVarObject_HEAD_INIT(0, 0)
22389  "cpartitioning.Enum", /*tp_name*/
22390  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
22391  0, /*tp_itemsize*/
22392  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
22393  #if PY_VERSION_HEX < 0x030800b4
22394  0, /*tp_print*/
22395  #endif
22396  #if PY_VERSION_HEX >= 0x030800b4
22397  0, /*tp_vectorcall_offset*/
22398  #endif
22399  0, /*tp_getattr*/
22400  0, /*tp_setattr*/
22401  #if PY_MAJOR_VERSION < 3
22402  0, /*tp_compare*/
22403  #endif
22404  #if PY_MAJOR_VERSION >= 3
22405  0, /*tp_as_async*/
22406  #endif
22407  __pyx_MemviewEnum___repr__, /*tp_repr*/
22408  0, /*tp_as_number*/
22409  0, /*tp_as_sequence*/
22410  0, /*tp_as_mapping*/
22411  0, /*tp_hash*/
22412  0, /*tp_call*/
22413  0, /*tp_str*/
22414  0, /*tp_getattro*/
22415  0, /*tp_setattro*/
22416  0, /*tp_as_buffer*/
22417  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22418  0, /*tp_doc*/
22419  __pyx_tp_traverse_Enum, /*tp_traverse*/
22420  __pyx_tp_clear_Enum, /*tp_clear*/
22421  0, /*tp_richcompare*/
22422  0, /*tp_weaklistoffset*/
22423  0, /*tp_iter*/
22424  0, /*tp_iternext*/
22425  __pyx_methods_Enum, /*tp_methods*/
22426  0, /*tp_members*/
22427  0, /*tp_getset*/
22428  0, /*tp_base*/
22429  0, /*tp_dict*/
22430  0, /*tp_descr_get*/
22431  0, /*tp_descr_set*/
22432  0, /*tp_dictoffset*/
22433  __pyx_MemviewEnum___init__, /*tp_init*/
22434  0, /*tp_alloc*/
22435  __pyx_tp_new_Enum, /*tp_new*/
22436  0, /*tp_free*/
22437  0, /*tp_is_gc*/
22438  0, /*tp_bases*/
22439  0, /*tp_mro*/
22440  0, /*tp_cache*/
22441  0, /*tp_subclasses*/
22442  0, /*tp_weaklist*/
22443  0, /*tp_del*/
22444  0, /*tp_version_tag*/
22445  #if PY_VERSION_HEX >= 0x030400a1
22446  0, /*tp_finalize*/
22447  #endif
22448  #if PY_VERSION_HEX >= 0x030800b1
22449  0, /*tp_vectorcall*/
22450  #endif
22451  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22452  0, /*tp_print*/
22453  #endif
22454 };
22455 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22456 
22457 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22458  struct __pyx_memoryview_obj *p;
22459  PyObject *o;
22460  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22461  o = (*t->tp_alloc)(t, 0);
22462  } else {
22463  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22464  }
22465  if (unlikely(!o)) return 0;
22466  p = ((struct __pyx_memoryview_obj *)o);
22467  p->__pyx_vtab = __pyx_vtabptr_memoryview;
22468  p->obj = Py_None; Py_INCREF(Py_None);
22469  p->_size = Py_None; Py_INCREF(Py_None);
22470  p->_array_interface = Py_None; Py_INCREF(Py_None);
22471  p->view.obj = NULL;
22472  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
22473  return o;
22474  bad:
22475  Py_DECREF(o); o = 0;
22476  return NULL;
22477 }
22478 
22479 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22480  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22481  #if CYTHON_USE_TP_FINALIZE
22482  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22483  if (PyObject_CallFinalizerFromDealloc(o)) return;
22484  }
22485  #endif
22486  PyObject_GC_UnTrack(o);
22487  {
22488  PyObject *etype, *eval, *etb;
22489  PyErr_Fetch(&etype, &eval, &etb);
22490  ++Py_REFCNT(o);
22491  __pyx_memoryview___dealloc__(o);
22492  --Py_REFCNT(o);
22493  PyErr_Restore(etype, eval, etb);
22494  }
22495  Py_CLEAR(p->obj);
22496  Py_CLEAR(p->_size);
22497  Py_CLEAR(p->_array_interface);
22498  (*Py_TYPE(o)->tp_free)(o);
22499 }
22500 
22501 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
22502  int e;
22503  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22504  if (p->obj) {
22505  e = (*v)(p->obj, a); if (e) return e;
22506  }
22507  if (p->_size) {
22508  e = (*v)(p->_size, a); if (e) return e;
22509  }
22510  if (p->_array_interface) {
22511  e = (*v)(p->_array_interface, a); if (e) return e;
22512  }
22513  if (p->view.obj) {
22514  e = (*v)(p->view.obj, a); if (e) return e;
22515  }
22516  return 0;
22517 }
22518 
22519 static int __pyx_tp_clear_memoryview(PyObject *o) {
22520  PyObject* tmp;
22521  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22522  tmp = ((PyObject*)p->obj);
22523  p->obj = Py_None; Py_INCREF(Py_None);
22524  Py_XDECREF(tmp);
22525  tmp = ((PyObject*)p->_size);
22526  p->_size = Py_None; Py_INCREF(Py_None);
22527  Py_XDECREF(tmp);
22528  tmp = ((PyObject*)p->_array_interface);
22529  p->_array_interface = Py_None; Py_INCREF(Py_None);
22530  Py_XDECREF(tmp);
22531  Py_CLEAR(p->view.obj);
22532  return 0;
22533 }
22534 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22535  PyObject *r;
22536  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22537  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22538  Py_DECREF(x);
22539  return r;
22540 }
22541 
22542 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
22543  if (v) {
22544  return __pyx_memoryview___setitem__(o, i, v);
22545  }
22546  else {
22547  PyErr_Format(PyExc_NotImplementedError,
22548  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22549  return -1;
22550  }
22551 }
22552 
22553 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
22554  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22555 }
22556 
22557 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
22558  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22559 }
22560 
22561 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
22562  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22563 }
22564 
22565 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
22566  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22567 }
22568 
22569 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
22570  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22571 }
22572 
22573 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
22574  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22575 }
22576 
22577 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
22578  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22579 }
22580 
22581 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
22582  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22583 }
22584 
22585 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
22586  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22587 }
22588 
22589 static PyMethodDef __pyx_methods_memoryview[] = {
22590  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22591  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22592  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22593  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22594  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22595  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22596  {0, 0, 0, 0}
22597 };
22598 
22599 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22600  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
22601  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
22602  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
22603  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
22604  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
22605  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
22606  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
22607  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
22608  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
22609  {0, 0, 0, 0, 0}
22610 };
22611 
22612 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22613  __pyx_memoryview___len__, /*sq_length*/
22614  0, /*sq_concat*/
22615  0, /*sq_repeat*/
22616  __pyx_sq_item_memoryview, /*sq_item*/
22617  0, /*sq_slice*/
22618  0, /*sq_ass_item*/
22619  0, /*sq_ass_slice*/
22620  0, /*sq_contains*/
22621  0, /*sq_inplace_concat*/
22622  0, /*sq_inplace_repeat*/
22623 };
22624 
22625 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22626  __pyx_memoryview___len__, /*mp_length*/
22627  __pyx_memoryview___getitem__, /*mp_subscript*/
22628  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
22629 };
22630 
22631 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22632  #if PY_MAJOR_VERSION < 3
22633  0, /*bf_getreadbuffer*/
22634  #endif
22635  #if PY_MAJOR_VERSION < 3
22636  0, /*bf_getwritebuffer*/
22637  #endif
22638  #if PY_MAJOR_VERSION < 3
22639  0, /*bf_getsegcount*/
22640  #endif
22641  #if PY_MAJOR_VERSION < 3
22642  0, /*bf_getcharbuffer*/
22643  #endif
22644  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
22645  0, /*bf_releasebuffer*/
22646 };
22647 
22648 static PyTypeObject __pyx_type___pyx_memoryview = {
22649  PyVarObject_HEAD_INIT(0, 0)
22650  "cpartitioning.memoryview", /*tp_name*/
22651  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
22652  0, /*tp_itemsize*/
22653  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
22654  #if PY_VERSION_HEX < 0x030800b4
22655  0, /*tp_print*/
22656  #endif
22657  #if PY_VERSION_HEX >= 0x030800b4
22658  0, /*tp_vectorcall_offset*/
22659  #endif
22660  0, /*tp_getattr*/
22661  0, /*tp_setattr*/
22662  #if PY_MAJOR_VERSION < 3
22663  0, /*tp_compare*/
22664  #endif
22665  #if PY_MAJOR_VERSION >= 3
22666  0, /*tp_as_async*/
22667  #endif
22668  __pyx_memoryview___repr__, /*tp_repr*/
22669  0, /*tp_as_number*/
22670  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
22671  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
22672  0, /*tp_hash*/
22673  0, /*tp_call*/
22674  __pyx_memoryview___str__, /*tp_str*/
22675  0, /*tp_getattro*/
22676  0, /*tp_setattro*/
22677  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
22678  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22679  0, /*tp_doc*/
22680  __pyx_tp_traverse_memoryview, /*tp_traverse*/
22681  __pyx_tp_clear_memoryview, /*tp_clear*/
22682  0, /*tp_richcompare*/
22683  0, /*tp_weaklistoffset*/
22684  0, /*tp_iter*/
22685  0, /*tp_iternext*/
22686  __pyx_methods_memoryview, /*tp_methods*/
22687  0, /*tp_members*/
22688  __pyx_getsets_memoryview, /*tp_getset*/
22689  0, /*tp_base*/
22690  0, /*tp_dict*/
22691  0, /*tp_descr_get*/
22692  0, /*tp_descr_set*/
22693  0, /*tp_dictoffset*/
22694  0, /*tp_init*/
22695  0, /*tp_alloc*/
22696  __pyx_tp_new_memoryview, /*tp_new*/
22697  0, /*tp_free*/
22698  0, /*tp_is_gc*/
22699  0, /*tp_bases*/
22700  0, /*tp_mro*/
22701  0, /*tp_cache*/
22702  0, /*tp_subclasses*/
22703  0, /*tp_weaklist*/
22704  0, /*tp_del*/
22705  0, /*tp_version_tag*/
22706  #if PY_VERSION_HEX >= 0x030400a1
22707  0, /*tp_finalize*/
22708  #endif
22709  #if PY_VERSION_HEX >= 0x030800b1
22710  0, /*tp_vectorcall*/
22711  #endif
22712  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22713  0, /*tp_print*/
22714  #endif
22715 };
22716 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22717 
22718 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22719  struct __pyx_memoryviewslice_obj *p;
22720  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22721  if (unlikely(!o)) return 0;
22722  p = ((struct __pyx_memoryviewslice_obj *)o);
22723  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22724  p->from_object = Py_None; Py_INCREF(Py_None);
22725  p->from_slice.memview = NULL;
22726  return o;
22727 }
22728 
22729 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22730  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22731  #if CYTHON_USE_TP_FINALIZE
22732  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22733  if (PyObject_CallFinalizerFromDealloc(o)) return;
22734  }
22735  #endif
22736  PyObject_GC_UnTrack(o);
22737  {
22738  PyObject *etype, *eval, *etb;
22739  PyErr_Fetch(&etype, &eval, &etb);
22740  ++Py_REFCNT(o);
22741  __pyx_memoryviewslice___dealloc__(o);
22742  --Py_REFCNT(o);
22743  PyErr_Restore(etype, eval, etb);
22744  }
22745  Py_CLEAR(p->from_object);
22746  PyObject_GC_Track(o);
22747  __pyx_tp_dealloc_memoryview(o);
22748 }
22749 
22750 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22751  int e;
22752  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22753  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22754  if (p->from_object) {
22755  e = (*v)(p->from_object, a); if (e) return e;
22756  }
22757  return 0;
22758 }
22759 
22760 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22761  PyObject* tmp;
22762  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22763  __pyx_tp_clear_memoryview(o);
22764  tmp = ((PyObject*)p->from_object);
22765  p->from_object = Py_None; Py_INCREF(Py_None);
22766  Py_XDECREF(tmp);
22767  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22768  return 0;
22769 }
22770 
22771 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22772  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22773 }
22774 
22775 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22776  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22777  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22778  {0, 0, 0, 0}
22779 };
22780 
22781 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22782  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22783  {0, 0, 0, 0, 0}
22784 };
22785 
22786 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22787  PyVarObject_HEAD_INIT(0, 0)
22788  "cpartitioning._memoryviewslice", /*tp_name*/
22789  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22790  0, /*tp_itemsize*/
22791  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22792  #if PY_VERSION_HEX < 0x030800b4
22793  0, /*tp_print*/
22794  #endif
22795  #if PY_VERSION_HEX >= 0x030800b4
22796  0, /*tp_vectorcall_offset*/
22797  #endif
22798  0, /*tp_getattr*/
22799  0, /*tp_setattr*/
22800  #if PY_MAJOR_VERSION < 3
22801  0, /*tp_compare*/
22802  #endif
22803  #if PY_MAJOR_VERSION >= 3
22804  0, /*tp_as_async*/
22805  #endif
22806  #if CYTHON_COMPILING_IN_PYPY
22807  __pyx_memoryview___repr__, /*tp_repr*/
22808  #else
22809  0, /*tp_repr*/
22810  #endif
22811  0, /*tp_as_number*/
22812  0, /*tp_as_sequence*/
22813  0, /*tp_as_mapping*/
22814  0, /*tp_hash*/
22815  0, /*tp_call*/
22816  #if CYTHON_COMPILING_IN_PYPY
22817  __pyx_memoryview___str__, /*tp_str*/
22818  #else
22819  0, /*tp_str*/
22820  #endif
22821  0, /*tp_getattro*/
22822  0, /*tp_setattro*/
22823  0, /*tp_as_buffer*/
22824  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22825  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22826  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22827  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22828  0, /*tp_richcompare*/
22829  0, /*tp_weaklistoffset*/
22830  0, /*tp_iter*/
22831  0, /*tp_iternext*/
22832  __pyx_methods__memoryviewslice, /*tp_methods*/
22833  0, /*tp_members*/
22834  __pyx_getsets__memoryviewslice, /*tp_getset*/
22835  0, /*tp_base*/
22836  0, /*tp_dict*/
22837  0, /*tp_descr_get*/
22838  0, /*tp_descr_set*/
22839  0, /*tp_dictoffset*/
22840  0, /*tp_init*/
22841  0, /*tp_alloc*/
22842  __pyx_tp_new__memoryviewslice, /*tp_new*/
22843  0, /*tp_free*/
22844  0, /*tp_is_gc*/
22845  0, /*tp_bases*/
22846  0, /*tp_mro*/
22847  0, /*tp_cache*/
22848  0, /*tp_subclasses*/
22849  0, /*tp_weaklist*/
22850  0, /*tp_del*/
22851  0, /*tp_version_tag*/
22852  #if PY_VERSION_HEX >= 0x030400a1
22853  0, /*tp_finalize*/
22854  #endif
22855  #if PY_VERSION_HEX >= 0x030800b1
22856  0, /*tp_vectorcall*/
22857  #endif
22858  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22859  0, /*tp_print*/
22860  #endif
22861 };
22862 
22863 static PyMethodDef __pyx_methods[] = {
22864  {0, 0, 0, 0}
22865 };
22866 
22867 #if PY_MAJOR_VERSION >= 3
22868 #if CYTHON_PEP489_MULTI_PHASE_INIT
22869 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22870 static int __pyx_pymod_exec_cpartitioning(PyObject* module); /*proto*/
22871 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22872  {Py_mod_create, (void*)__pyx_pymod_create},
22873  {Py_mod_exec, (void*)__pyx_pymod_exec_cpartitioning},
22874  {0, NULL}
22875 };
22876 #endif
22877 
22878 static struct PyModuleDef __pyx_moduledef = {
22879  PyModuleDef_HEAD_INIT,
22880  "cpartitioning",
22881  0, /* m_doc */
22882  #if CYTHON_PEP489_MULTI_PHASE_INIT
22883  0, /* m_size */
22884  #else
22885  -1, /* m_size */
22886  #endif
22887  __pyx_methods /* m_methods */,
22888  #if CYTHON_PEP489_MULTI_PHASE_INIT
22889  __pyx_moduledef_slots, /* m_slots */
22890  #else
22891  NULL, /* m_reload */
22892  #endif
22893  NULL, /* m_traverse */
22894  NULL, /* m_clear */
22895  NULL /* m_free */
22896 };
22897 #endif
22898 #ifndef CYTHON_SMALL_CODE
22899 #if defined(__clang__)
22900  #define CYTHON_SMALL_CODE
22901 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22902  #define CYTHON_SMALL_CODE __attribute__((cold))
22903 #else
22904  #define CYTHON_SMALL_CODE
22905 #endif
22906 #endif
22907 
22908 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22909  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22910  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22911  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22912  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22913  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22914  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22915  {&__pyx_n_s_Comm, __pyx_k_Comm, sizeof(__pyx_k_Comm), 0, 0, 1, 1},
22916  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22917  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22918  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
22919  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
22920  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22921  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22922  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22923  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22924  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22925  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22926  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22927  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22928  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22929  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
22930  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22931  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22932  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22933  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
22934  {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0},
22935  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22936  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22937  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22938  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22939  {&__pyx_kp_b__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 0, 0},
22940  {&__pyx_kp_b__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 0, 0, 0},
22941  {&__pyx_kp_b__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 0, 0},
22942  {&__pyx_kp_b__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 0, 0},
22943  {&__pyx_kp_u__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0, 0},
22944  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22945  {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
22946  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22947  {&__pyx_n_s_buildDiscontinuousGalerkinLocal2, __pyx_k_buildDiscontinuousGalerkinLocal2, sizeof(__pyx_k_buildDiscontinuousGalerkinLocal2), 0, 0, 1, 1},
22948  {&__pyx_n_s_buildQuadraticCubeLocal2GlobalMa, __pyx_k_buildQuadraticCubeLocal2GlobalMa, sizeof(__pyx_k_buildQuadraticCubeLocal2GlobalMa), 0, 0, 1, 1},
22949  {&__pyx_kp_s_buildQuadraticCubeSubdomain2Glob, __pyx_k_buildQuadraticCubeSubdomain2Glob, sizeof(__pyx_k_buildQuadraticCubeSubdomain2Glob), 0, 0, 1, 0},
22950  {&__pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2, __pyx_k_buildQuadraticCubeSubdomain2Glob_2, sizeof(__pyx_k_buildQuadraticCubeSubdomain2Glob_2), 0, 0, 1, 0},
22951  {&__pyx_n_s_buildQuadraticLocal2GlobalMappin, __pyx_k_buildQuadraticLocal2GlobalMappin, sizeof(__pyx_k_buildQuadraticLocal2GlobalMappin), 0, 0, 1, 1},
22952  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22953  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22954  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22955  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22956  {&__pyx_n_s_cmesh, __pyx_k_cmesh, sizeof(__pyx_k_cmesh), 0, 0, 1, 1},
22957  {&__pyx_n_s_comm, __pyx_k_comm, sizeof(__pyx_k_comm), 0, 0, 1, 1},
22958  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22959  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22960  {&__pyx_n_s_convertPUMIPartitionToPython, __pyx_k_convertPUMIPartitionToPython, sizeof(__pyx_k_convertPUMIPartitionToPython), 0, 0, 1, 1},
22961  {&__pyx_n_s_cpartitioning, __pyx_k_cpartitioning, sizeof(__pyx_k_cpartitioning), 0, 0, 1, 1},
22962  {&__pyx_n_s_dgNumbering_subdomain2global, __pyx_k_dgNumbering_subdomain2global, sizeof(__pyx_k_dgNumbering_subdomain2global), 0, 0, 1, 1},
22963  {&__pyx_n_s_dg_dof_offsets_subdomain_owned, __pyx_k_dg_dof_offsets_subdomain_owned, sizeof(__pyx_k_dg_dof_offsets_subdomain_owned), 0, 0, 1, 1},
22964  {&__pyx_n_s_dg_subdomain_l2g, __pyx_k_dg_subdomain_l2g, sizeof(__pyx_k_dg_subdomain_l2g), 0, 0, 1, 1},
22965  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22966  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22967  {&__pyx_n_s_edgeNumbering_subdomain2global, __pyx_k_edgeNumbering_subdomain2global, sizeof(__pyx_k_edgeNumbering_subdomain2global), 0, 0, 1, 1},
22968  {&__pyx_n_s_edgeOffsets_subdomain_owned, __pyx_k_edgeOffsets_subdomain_owned, sizeof(__pyx_k_edgeOffsets_subdomain_owned), 0, 0, 1, 1},
22969  {&__pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_k_elementBoundaryNumbering_subdoma, sizeof(__pyx_k_elementBoundaryNumbering_subdoma), 0, 0, 1, 1},
22970  {&__pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_k_elementBoundaryOffsets_subdomain, sizeof(__pyx_k_elementBoundaryOffsets_subdomain), 0, 0, 1, 1},
22971  {&__pyx_n_s_elementNumbering_subdomain2globa, __pyx_k_elementNumbering_subdomain2globa, sizeof(__pyx_k_elementNumbering_subdomain2globa), 0, 0, 1, 1},
22972  {&__pyx_n_s_elementOffsets_subdomain_owned, __pyx_k_elementOffsets_subdomain_owned, sizeof(__pyx_k_elementOffsets_subdomain_owned), 0, 0, 1, 1},
22973  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22974  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22975  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22976  {&__pyx_n_s_filebase, __pyx_k_filebase, sizeof(__pyx_k_filebase), 0, 0, 1, 1},
22977  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22978  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22979  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22980  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22981  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22982  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22983  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22984  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22985  {&__pyx_n_s_indexBase, __pyx_k_indexBase, sizeof(__pyx_k_indexBase), 0, 0, 1, 1},
22986  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22987  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22988  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
22989  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22990  {&__pyx_n_s_max_dof_neighbors, __pyx_k_max_dof_neighbors, sizeof(__pyx_k_max_dof_neighbors), 0, 0, 1, 1},
22991  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22992  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22993  {&__pyx_n_s_nDOF_all_processes, __pyx_k_nDOF_all_processes, sizeof(__pyx_k_nDOF_all_processes), 0, 0, 1, 1},
22994  {&__pyx_n_s_nDOF_element, __pyx_k_nDOF_element, sizeof(__pyx_k_nDOF_element), 0, 0, 1, 1},
22995  {&__pyx_n_s_nDOF_subdomain, __pyx_k_nDOF_subdomain, sizeof(__pyx_k_nDOF_subdomain), 0, 0, 1, 1},
22996  {&__pyx_n_s_nLayersOfOverlap, __pyx_k_nLayersOfOverlap, sizeof(__pyx_k_nLayersOfOverlap), 0, 0, 1, 1},
22997  {&__pyx_n_s_nSpace, __pyx_k_nSpace, sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
22998  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22999  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
23000  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
23001  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
23002  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
23003  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
23004  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
23005  {&__pyx_n_s_nodeNumbering_subdomain2global, __pyx_k_nodeNumbering_subdomain2global, sizeof(__pyx_k_nodeNumbering_subdomain2global), 0, 0, 1, 1},
23006  {&__pyx_n_s_nodeOffsets_subdomain_owned, __pyx_k_nodeOffsets_subdomain_owned, sizeof(__pyx_k_nodeOffsets_subdomain_owned), 0, 0, 1, 1},
23007  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
23008  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
23009  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
23010  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
23011  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
23012  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
23013  {&__pyx_n_s_partitionElements, __pyx_k_partitionElements, sizeof(__pyx_k_partitionElements), 0, 0, 1, 1},
23014  {&__pyx_n_s_partitionNodes, __pyx_k_partitionNodes, sizeof(__pyx_k_partitionNodes), 0, 0, 1, 1},
23015  {&__pyx_n_s_partitionNodesFromTetgenFiles, __pyx_k_partitionNodesFromTetgenFiles, sizeof(__pyx_k_partitionNodesFromTetgenFiles), 0, 0, 1, 1},
23016  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
23017  {&__pyx_n_s_proteus, __pyx_k_proteus, sizeof(__pyx_k_proteus), 0, 0, 1, 1},
23018  {&__pyx_n_s_proteus_Comm, __pyx_k_proteus_Comm, sizeof(__pyx_k_proteus_Comm), 0, 0, 1, 1},
23019  {&__pyx_kp_s_proteus_cpartitioning_pyx, __pyx_k_proteus_cpartitioning_pyx, sizeof(__pyx_k_proteus_cpartitioning_pyx), 0, 0, 1, 0},
23020  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
23021  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
23022  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
23023  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
23024  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
23025  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
23026  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
23027  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
23028  {&__pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_k_quadraticNumbering_subdomain2glo, sizeof(__pyx_k_quadraticNumbering_subdomain2glo), 0, 0, 1, 1},
23029  {&__pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_k_quadratic_dof_offsets_subdomain, sizeof(__pyx_k_quadratic_dof_offsets_subdomain), 0, 0, 1, 1},
23030  {&__pyx_n_s_quadratic_lagrangeNodes, __pyx_k_quadratic_lagrangeNodes, sizeof(__pyx_k_quadratic_lagrangeNodes), 0, 0, 1, 1},
23031  {&__pyx_n_s_quadratic_subdomain_l2g, __pyx_k_quadratic_subdomain_l2g, sizeof(__pyx_k_quadratic_subdomain_l2g), 0, 0, 1, 1},
23032  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
23033  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
23034  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
23035  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
23036  {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
23037  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
23038  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
23039  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
23040  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
23041  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
23042  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
23043  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
23044  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
23045  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
23046  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
23047  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
23048  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
23049  {&__pyx_n_s_subdomain_cmesh, __pyx_k_subdomain_cmesh, sizeof(__pyx_k_subdomain_cmesh), 0, 0, 1, 1},
23050  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
23051  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
23052  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
23053  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
23054  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
23055  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
23056  {0, 0, 0, 0, 0, 0, 0}
23057 };
23058 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
23059  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 272, __pyx_L1_error)
23060  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 285, __pyx_L1_error)
23061  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 856, __pyx_L1_error)
23062  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1038, __pyx_L1_error)
23063  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error)
23064  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error)
23065  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error)
23066  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error)
23067  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 613, __pyx_L1_error)
23068  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 832, __pyx_L1_error)
23069  return 0;
23070  __pyx_L1_error:;
23071  return -1;
23072 }
23073 
23074 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
23075  __Pyx_RefNannyDeclarations
23076  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
23077 
23078  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
23079  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
23080  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
23081  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
23082  *
23083  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
23084  */
23085  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 272, __pyx_L1_error)
23086  __Pyx_GOTREF(__pyx_tuple_);
23087  __Pyx_GIVEREF(__pyx_tuple_);
23088 
23089  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
23090  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
23091  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
23092  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
23093  *
23094  * info.buf = PyArray_DATA(self)
23095  */
23096  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 276, __pyx_L1_error)
23097  __Pyx_GOTREF(__pyx_tuple__2);
23098  __Pyx_GIVEREF(__pyx_tuple__2);
23099 
23100  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
23101  * if ((descr.byteorder == c'>' and little_endian) or
23102  * (descr.byteorder == c'<' and not little_endian)):
23103  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
23104  * if t == NPY_BYTE: f = "b"
23105  * elif t == NPY_UBYTE: f = "B"
23106  */
23107  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 306, __pyx_L1_error)
23108  __Pyx_GOTREF(__pyx_tuple__3);
23109  __Pyx_GIVEREF(__pyx_tuple__3);
23110 
23111  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
23112  *
23113  * if (end - f) - <int>(new_offset - offset[0]) < 15:
23114  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
23115  *
23116  * if ((child.byteorder == c'>' and little_endian) or
23117  */
23118  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 856, __pyx_L1_error)
23119  __Pyx_GOTREF(__pyx_tuple__4);
23120  __Pyx_GIVEREF(__pyx_tuple__4);
23121 
23122  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
23123  * t = child.type_num
23124  * if end - f < 5:
23125  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
23126  *
23127  * # Until ticket #99 is fixed, use integers to avoid warnings
23128  */
23129  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 880, __pyx_L1_error)
23130  __Pyx_GOTREF(__pyx_tuple__5);
23131  __Pyx_GIVEREF(__pyx_tuple__5);
23132 
23133  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
23134  * _import_array()
23135  * except Exception:
23136  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
23137  *
23138  * cdef inline int import_umath() except -1:
23139  */
23140  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 1038, __pyx_L1_error)
23141  __Pyx_GOTREF(__pyx_tuple__6);
23142  __Pyx_GIVEREF(__pyx_tuple__6);
23143 
23144  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
23145  * _import_umath()
23146  * except Exception:
23147  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
23148  *
23149  * cdef inline int import_ufunc() except -1:
23150  */
23151  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 1044, __pyx_L1_error)
23152  __Pyx_GOTREF(__pyx_tuple__7);
23153  __Pyx_GIVEREF(__pyx_tuple__7);
23154 
23155  /* "View.MemoryView":133
23156  *
23157  * if not self.ndim:
23158  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
23159  *
23160  * if itemsize <= 0:
23161  */
23162  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 133, __pyx_L1_error)
23163  __Pyx_GOTREF(__pyx_tuple__8);
23164  __Pyx_GIVEREF(__pyx_tuple__8);
23165 
23166  /* "View.MemoryView":136
23167  *
23168  * if itemsize <= 0:
23169  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
23170  *
23171  * if not isinstance(format, bytes):
23172  */
23173  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 136, __pyx_L1_error)
23174  __Pyx_GOTREF(__pyx_tuple__9);
23175  __Pyx_GIVEREF(__pyx_tuple__9);
23176 
23177  /* "View.MemoryView":148
23178  *
23179  * if not self._shape:
23180  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
23181  *
23182  *
23183  */
23184  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 148, __pyx_L1_error)
23185  __Pyx_GOTREF(__pyx_tuple__10);
23186  __Pyx_GIVEREF(__pyx_tuple__10);
23187 
23188  /* "View.MemoryView":176
23189  * self.data = <char *>malloc(self.len)
23190  * if not self.data:
23191  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
23192  *
23193  * if self.dtype_is_object:
23194  */
23195  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 176, __pyx_L1_error)
23196  __Pyx_GOTREF(__pyx_tuple__11);
23197  __Pyx_GIVEREF(__pyx_tuple__11);
23198 
23199  /* "View.MemoryView":192
23200  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
23201  * if not (flags & bufmode):
23202  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
23203  * info.buf = self.data
23204  * info.len = self.len
23205  */
23206  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 192, __pyx_L1_error)
23207  __Pyx_GOTREF(__pyx_tuple__12);
23208  __Pyx_GIVEREF(__pyx_tuple__12);
23209 
23210  /* "(tree fragment)":2
23211  * def __reduce_cython__(self):
23212  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23213  * def __setstate_cython__(self, __pyx_state):
23214  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23215  */
23216  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 2, __pyx_L1_error)
23217  __Pyx_GOTREF(__pyx_tuple__13);
23218  __Pyx_GIVEREF(__pyx_tuple__13);
23219 
23220  /* "(tree fragment)":4
23221  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23222  * def __setstate_cython__(self, __pyx_state):
23223  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23224  */
23225  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 4, __pyx_L1_error)
23226  __Pyx_GOTREF(__pyx_tuple__14);
23227  __Pyx_GIVEREF(__pyx_tuple__14);
23228 
23229  /* "View.MemoryView":418
23230  * def __setitem__(memoryview self, object index, object value):
23231  * if self.view.readonly:
23232  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
23233  *
23234  * have_slices, index = _unellipsify(index, self.view.ndim)
23235  */
23236  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 418, __pyx_L1_error)
23237  __Pyx_GOTREF(__pyx_tuple__15);
23238  __Pyx_GIVEREF(__pyx_tuple__15);
23239 
23240  /* "View.MemoryView":495
23241  * result = struct.unpack(self.view.format, bytesitem)
23242  * except struct.error:
23243  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
23244  * else:
23245  * if len(self.view.format) == 1:
23246  */
23247  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 495, __pyx_L1_error)
23248  __Pyx_GOTREF(__pyx_tuple__16);
23249  __Pyx_GIVEREF(__pyx_tuple__16);
23250 
23251  /* "View.MemoryView":520
23252  * def __getbuffer__(self, Py_buffer *info, int flags):
23253  * if flags & PyBUF_WRITABLE and self.view.readonly:
23254  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
23255  *
23256  * if flags & PyBUF_ND:
23257  */
23258  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 520, __pyx_L1_error)
23259  __Pyx_GOTREF(__pyx_tuple__17);
23260  __Pyx_GIVEREF(__pyx_tuple__17);
23261 
23262  /* "View.MemoryView":570
23263  * if self.view.strides == NULL:
23264  *
23265  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
23266  *
23267  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
23268  */
23269  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 570, __pyx_L1_error)
23270  __Pyx_GOTREF(__pyx_tuple__18);
23271  __Pyx_GIVEREF(__pyx_tuple__18);
23272 
23273  /* "View.MemoryView":577
23274  * def suboffsets(self):
23275  * if self.view.suboffsets == NULL:
23276  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
23277  *
23278  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
23279  */
23280  __pyx_tuple__19 = PyTuple_New(1); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 577, __pyx_L1_error)
23281  __Pyx_GOTREF(__pyx_tuple__19);
23282  __Pyx_INCREF(__pyx_int_neg_1);
23283  __Pyx_GIVEREF(__pyx_int_neg_1);
23284  PyTuple_SET_ITEM(__pyx_tuple__19, 0, __pyx_int_neg_1);
23285  __Pyx_GIVEREF(__pyx_tuple__19);
23286 
23287  /* "(tree fragment)":2
23288  * def __reduce_cython__(self):
23289  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23290  * def __setstate_cython__(self, __pyx_state):
23291  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23292  */
23293  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 2, __pyx_L1_error)
23294  __Pyx_GOTREF(__pyx_tuple__20);
23295  __Pyx_GIVEREF(__pyx_tuple__20);
23296 
23297  /* "(tree fragment)":4
23298  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23299  * def __setstate_cython__(self, __pyx_state):
23300  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23301  */
23302  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 4, __pyx_L1_error)
23303  __Pyx_GOTREF(__pyx_tuple__21);
23304  __Pyx_GIVEREF(__pyx_tuple__21);
23305 
23306  /* "View.MemoryView":682
23307  * if item is Ellipsis:
23308  * if not seen_ellipsis:
23309  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
23310  * seen_ellipsis = True
23311  * else:
23312  */
23313  __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(2, 682, __pyx_L1_error)
23314  __Pyx_GOTREF(__pyx_slice__22);
23315  __Pyx_GIVEREF(__pyx_slice__22);
23316 
23317  /* "View.MemoryView":703
23318  * for suboffset in suboffsets[:ndim]:
23319  * if suboffset >= 0:
23320  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
23321  *
23322  *
23323  */
23324  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 703, __pyx_L1_error)
23325  __Pyx_GOTREF(__pyx_tuple__23);
23326  __Pyx_GIVEREF(__pyx_tuple__23);
23327 
23328  /* "(tree fragment)":2
23329  * def __reduce_cython__(self):
23330  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23331  * def __setstate_cython__(self, __pyx_state):
23332  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23333  */
23334  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 2, __pyx_L1_error)
23335  __Pyx_GOTREF(__pyx_tuple__24);
23336  __Pyx_GIVEREF(__pyx_tuple__24);
23337 
23338  /* "(tree fragment)":4
23339  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23340  * def __setstate_cython__(self, __pyx_state):
23341  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23342  */
23343  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 4, __pyx_L1_error)
23344  __Pyx_GOTREF(__pyx_tuple__25);
23345  __Pyx_GIVEREF(__pyx_tuple__25);
23346 
23347  /* "cpartitioning.pyx":19
23348  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
23349  *
23350  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23351  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23352  * c_partitionElements(comm.ob_mpi,
23353  */
23354  __pyx_tuple__31 = PyTuple_Pack(4, __pyx_n_s_comm, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 19, __pyx_L1_error)
23355  __Pyx_GOTREF(__pyx_tuple__31);
23356  __Pyx_GIVEREF(__pyx_tuple__31);
23357  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionElements, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 19, __pyx_L1_error)
23358 
23359  /* "cpartitioning.pyx":35
23360  * )
23361  *
23362  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23363  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23364  * c_partitionNodes(comm.ob_mpi,
23365  */
23366  __pyx_tuple__33 = PyTuple_Pack(4, __pyx_n_s_comm, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 35, __pyx_L1_error)
23367  __Pyx_GOTREF(__pyx_tuple__33);
23368  __Pyx_GIVEREF(__pyx_tuple__33);
23369  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodes, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 35, __pyx_L1_error)
23370 
23371  /* "cpartitioning.pyx":51
23372  * )
23373  *
23374  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23375  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
23376  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23377  */
23378  __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_comm, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 51, __pyx_L1_error)
23379  __Pyx_GOTREF(__pyx_tuple__35);
23380  __Pyx_GIVEREF(__pyx_tuple__35);
23381  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_convertPUMIPartitionToPython, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 51, __pyx_L1_error)
23382 
23383  /* "cpartitioning.pyx":65
23384  * )
23385  *
23386  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23387  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23388  * if not isinstance(filebase, bytes):
23389  */
23390  __pyx_tuple__37 = PyTuple_Pack(6, __pyx_n_s_comm, __pyx_n_s_filebase, __pyx_n_s_indexBase, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 65, __pyx_L1_error)
23391  __Pyx_GOTREF(__pyx_tuple__37);
23392  __Pyx_GIVEREF(__pyx_tuple__37);
23393  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodesFromTetgenFiles, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 65, __pyx_L1_error)
23394 
23395  /* "cpartitioning.pyx":85
23396  * )
23397  *
23398  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23399  * int nSpace,
23400  * cmeshTools.CMesh cmesh,
23401  */
23402  __pyx_tuple__39 = PyTuple_Pack(19, __pyx_n_s_comm, __pyx_n_s_nSpace, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_nodeOffsets_subdomain_owned, __pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_n_s_edgeOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_nodeNumbering_subdomain2global, __pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_n_s_edgeNumbering_subdomain2global, __pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_n_s_quadratic_subdomain_l2g, __pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_n_s_quadratic_lagrangeNodes, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 85, __pyx_L1_error)
23403  __Pyx_GOTREF(__pyx_tuple__39);
23404  __Pyx_GIVEREF(__pyx_tuple__39);
23405  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(16, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildQuadraticLocal2GlobalMappin, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 85, __pyx_L1_error)
23406 
23407  /* "cpartitioning.pyx":150
23408  * max_dof_neighbors)
23409  *
23410  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23411  * int nSpace,
23412  * cmeshTools.CMesh cmesh,
23413  */
23414  __pyx_tuple__41 = PyTuple_Pack(19, __pyx_n_s_comm, __pyx_n_s_nSpace, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_nodeOffsets_subdomain_owned, __pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_n_s_edgeOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_nodeNumbering_subdomain2global, __pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_n_s_edgeNumbering_subdomain2global, __pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_n_s_quadratic_subdomain_l2g, __pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_n_s_quadratic_lagrangeNodes, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 150, __pyx_L1_error)
23415  __Pyx_GOTREF(__pyx_tuple__41);
23416  __Pyx_GIVEREF(__pyx_tuple__41);
23417  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(16, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildQuadraticCubeLocal2GlobalMa, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 150, __pyx_L1_error)
23418 
23419  /* "cpartitioning.pyx":191
23420  * max_dof_neighbors)
23421  *
23422  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23423  * int nDOF_element,
23424  * cmeshTools.CMesh cmesh,
23425  */
23426  __pyx_tuple__43 = PyTuple_Pack(12, __pyx_n_s_comm, __pyx_n_s_nDOF_element, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_dg_dof_offsets_subdomain_owned, __pyx_n_s_dg_subdomain_l2g, __pyx_n_s_dgNumbering_subdomain2global, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 191, __pyx_L1_error)
23427  __Pyx_GOTREF(__pyx_tuple__43);
23428  __Pyx_GIVEREF(__pyx_tuple__43);
23429  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildDiscontinuousGalerkinLocal2, 191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 191, __pyx_L1_error)
23430 
23431  /* "View.MemoryView":286
23432  * return self.name
23433  *
23434  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23435  * cdef strided = Enum("<strided and direct>") # default
23436  * cdef indirect = Enum("<strided and indirect>")
23437  */
23438  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 286, __pyx_L1_error)
23439  __Pyx_GOTREF(__pyx_tuple__45);
23440  __Pyx_GIVEREF(__pyx_tuple__45);
23441 
23442  /* "View.MemoryView":287
23443  *
23444  * cdef generic = Enum("<strided and direct or indirect>")
23445  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23446  * cdef indirect = Enum("<strided and indirect>")
23447  *
23448  */
23449  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 287, __pyx_L1_error)
23450  __Pyx_GOTREF(__pyx_tuple__46);
23451  __Pyx_GIVEREF(__pyx_tuple__46);
23452 
23453  /* "View.MemoryView":288
23454  * cdef generic = Enum("<strided and direct or indirect>")
23455  * cdef strided = Enum("<strided and direct>") # default
23456  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23457  *
23458  *
23459  */
23460  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 288, __pyx_L1_error)
23461  __Pyx_GOTREF(__pyx_tuple__47);
23462  __Pyx_GIVEREF(__pyx_tuple__47);
23463 
23464  /* "View.MemoryView":291
23465  *
23466  *
23467  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23468  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23469  *
23470  */
23471  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(2, 291, __pyx_L1_error)
23472  __Pyx_GOTREF(__pyx_tuple__48);
23473  __Pyx_GIVEREF(__pyx_tuple__48);
23474 
23475  /* "View.MemoryView":292
23476  *
23477  * cdef contiguous = Enum("<contiguous and direct>")
23478  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23479  *
23480  *
23481  */
23482  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 292, __pyx_L1_error)
23483  __Pyx_GOTREF(__pyx_tuple__49);
23484  __Pyx_GIVEREF(__pyx_tuple__49);
23485 
23486  /* "(tree fragment)":1
23487  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23488  * cdef object __pyx_PickleError
23489  * cdef object __pyx_result
23490  */
23491  __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(2, 1, __pyx_L1_error)
23492  __Pyx_GOTREF(__pyx_tuple__50);
23493  __Pyx_GIVEREF(__pyx_tuple__50);
23494  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(2, 1, __pyx_L1_error)
23495  __Pyx_RefNannyFinishContext();
23496  return 0;
23497  __pyx_L1_error:;
23498  __Pyx_RefNannyFinishContext();
23499  return -1;
23500 }
23501 
23502 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
23503  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23504  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23505  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23506  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23507  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23508  return 0;
23509  __pyx_L1_error:;
23510  return -1;
23511 }
23512 
23513 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
23514 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
23515 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
23516 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
23517 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
23518 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
23519 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
23520 
23521 static int __Pyx_modinit_global_init_code(void) {
23522  __Pyx_RefNannyDeclarations
23523  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
23524  /*--- Global init code ---*/
23525  generic = Py_None; Py_INCREF(Py_None);
23526  strided = Py_None; Py_INCREF(Py_None);
23527  indirect = Py_None; Py_INCREF(Py_None);
23528  contiguous = Py_None; Py_INCREF(Py_None);
23529  indirect_contiguous = Py_None; Py_INCREF(Py_None);
23530  __Pyx_RefNannyFinishContext();
23531  return 0;
23532 }
23533 
23534 static int __Pyx_modinit_variable_export_code(void) {
23535  __Pyx_RefNannyDeclarations
23536  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
23537  /*--- Variable export code ---*/
23538  __Pyx_RefNannyFinishContext();
23539  return 0;
23540 }
23541 
23542 static int __Pyx_modinit_function_export_code(void) {
23543  __Pyx_RefNannyDeclarations
23544  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
23545  /*--- Function export code ---*/
23546  __Pyx_RefNannyFinishContext();
23547  return 0;
23548 }
23549 
23550 static int __Pyx_modinit_type_init_code(void) {
23551  __Pyx_RefNannyDeclarations
23552  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
23553  /*--- Type init code ---*/
23554  __pyx_vtabptr_array = &__pyx_vtable_array;
23555  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
23556  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23557  #if PY_VERSION_HEX < 0x030800B1
23558  __pyx_type___pyx_array.tp_print = 0;
23559  #endif
23560  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23561  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23562  __pyx_array_type = &__pyx_type___pyx_array;
23563  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
23564  #if PY_VERSION_HEX < 0x030800B1
23565  __pyx_type___pyx_MemviewEnum.tp_print = 0;
23566  #endif
23567  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23568  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23569  }
23570  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
23571  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23572  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23573  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23574  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23575  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23576  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23577  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23578  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
23579  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23580  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23581  #if PY_VERSION_HEX < 0x030800B1
23582  __pyx_type___pyx_memoryview.tp_print = 0;
23583  #endif
23584  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23585  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23586  }
23587  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23588  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23589  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23590  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23591  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23592  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
23593  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23594  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23595  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
23596  #if PY_VERSION_HEX < 0x030800B1
23597  __pyx_type___pyx_memoryviewslice.tp_print = 0;
23598  #endif
23599  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23600  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23601  }
23602  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
23603  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
23604  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23605  __Pyx_RefNannyFinishContext();
23606  return 0;
23607  __pyx_L1_error:;
23608  __Pyx_RefNannyFinishContext();
23609  return -1;
23610 }
23611 
23612 static int __Pyx_modinit_type_import_code(void) {
23613  __Pyx_RefNannyDeclarations
23614  PyObject *__pyx_t_1 = NULL;
23615  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
23616  /*--- Type import code ---*/
23617  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
23618  __Pyx_GOTREF(__pyx_t_1);
23619  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
23620  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23621  sizeof(PyTypeObject),
23622  #else
23623  sizeof(PyHeapTypeObject),
23624  #endif
23625  __Pyx_ImportType_CheckSize_Warn);
23626  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
23627  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23628  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
23629  __Pyx_GOTREF(__pyx_t_1);
23630  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23631  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 206, __pyx_L1_error)
23632  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
23633  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 229, __pyx_L1_error)
23634  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
23635  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 233, __pyx_L1_error)
23636  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23637  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 242, __pyx_L1_error)
23638  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
23639  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 918, __pyx_L1_error)
23640  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23641  __pyx_t_1 = PyImport_ImportModule("mpi4py.MPI"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 28, __pyx_L1_error)
23642  __Pyx_GOTREF(__pyx_t_1);
23643  __pyx_ptype_6mpi4py_3MPI_Status = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Status", sizeof(struct PyMPIStatusObject), __Pyx_ImportType_CheckSize_Warn);
23644  if (!__pyx_ptype_6mpi4py_3MPI_Status) __PYX_ERR(4, 28, __pyx_L1_error)
23645  __pyx_ptype_6mpi4py_3MPI_Datatype = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Datatype", sizeof(struct PyMPIDatatypeObject), __Pyx_ImportType_CheckSize_Warn);
23646  if (!__pyx_ptype_6mpi4py_3MPI_Datatype) __PYX_ERR(4, 35, __pyx_L1_error)
23647  __pyx_ptype_6mpi4py_3MPI_Request = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Request", sizeof(struct PyMPIRequestObject), __Pyx_ImportType_CheckSize_Warn);
23648  if (!__pyx_ptype_6mpi4py_3MPI_Request) __PYX_ERR(4, 42, __pyx_L1_error)
23649  __pyx_ptype_6mpi4py_3MPI_Prequest = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Prequest", sizeof(struct PyMPIPrequestObject), __Pyx_ImportType_CheckSize_Warn);
23650  if (!__pyx_ptype_6mpi4py_3MPI_Prequest) __PYX_ERR(4, 50, __pyx_L1_error)
23651  __pyx_ptype_6mpi4py_3MPI_Grequest = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Grequest", sizeof(struct PyMPIGrequestObject), __Pyx_ImportType_CheckSize_Warn);
23652  if (!__pyx_ptype_6mpi4py_3MPI_Grequest) __PYX_ERR(4, 56, __pyx_L1_error)
23653  __pyx_ptype_6mpi4py_3MPI_Message = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Message", sizeof(struct PyMPIMessageObject), __Pyx_ImportType_CheckSize_Warn);
23654  if (!__pyx_ptype_6mpi4py_3MPI_Message) __PYX_ERR(4, 62, __pyx_L1_error)
23655  __pyx_ptype_6mpi4py_3MPI_Op = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Op", sizeof(struct PyMPIOpObject), __Pyx_ImportType_CheckSize_Warn);
23656  if (!__pyx_ptype_6mpi4py_3MPI_Op) __PYX_ERR(4, 70, __pyx_L1_error)
23657  __pyx_ptype_6mpi4py_3MPI_Group = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Group", sizeof(struct PyMPIGroupObject), __Pyx_ImportType_CheckSize_Warn);
23658  if (!__pyx_ptype_6mpi4py_3MPI_Group) __PYX_ERR(4, 79, __pyx_L1_error)
23659  __pyx_ptype_6mpi4py_3MPI_Info = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Info", sizeof(struct PyMPIInfoObject), __Pyx_ImportType_CheckSize_Warn);
23660  if (!__pyx_ptype_6mpi4py_3MPI_Info) __PYX_ERR(4, 86, __pyx_L1_error)
23661  __pyx_ptype_6mpi4py_3MPI_Errhandler = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Errhandler", sizeof(struct PyMPIErrhandlerObject), __Pyx_ImportType_CheckSize_Warn);
23662  if (!__pyx_ptype_6mpi4py_3MPI_Errhandler) __PYX_ERR(4, 93, __pyx_L1_error)
23663  __pyx_ptype_6mpi4py_3MPI_Comm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Comm", sizeof(struct PyMPICommObject), __Pyx_ImportType_CheckSize_Warn);
23664  if (!__pyx_ptype_6mpi4py_3MPI_Comm) __PYX_ERR(4, 100, __pyx_L1_error)
23665  __pyx_ptype_6mpi4py_3MPI_Intracomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Intracomm", sizeof(struct PyMPIIntracommObject), __Pyx_ImportType_CheckSize_Warn);
23666  if (!__pyx_ptype_6mpi4py_3MPI_Intracomm) __PYX_ERR(4, 107, __pyx_L1_error)
23667  __pyx_ptype_6mpi4py_3MPI_Topocomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Topocomm", sizeof(struct PyMPITopocommObject), __Pyx_ImportType_CheckSize_Warn);
23668  if (!__pyx_ptype_6mpi4py_3MPI_Topocomm) __PYX_ERR(4, 113, __pyx_L1_error)
23669  __pyx_ptype_6mpi4py_3MPI_Cartcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Cartcomm", sizeof(struct PyMPICartcommObject), __Pyx_ImportType_CheckSize_Warn);
23670  if (!__pyx_ptype_6mpi4py_3MPI_Cartcomm) __PYX_ERR(4, 119, __pyx_L1_error)
23671  __pyx_ptype_6mpi4py_3MPI_Graphcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Graphcomm", sizeof(struct PyMPIGraphcommObject), __Pyx_ImportType_CheckSize_Warn);
23672  if (!__pyx_ptype_6mpi4py_3MPI_Graphcomm) __PYX_ERR(4, 125, __pyx_L1_error)
23673  __pyx_ptype_6mpi4py_3MPI_Distgraphcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Distgraphcomm", sizeof(struct PyMPIDistgraphcommObject), __Pyx_ImportType_CheckSize_Warn);
23674  if (!__pyx_ptype_6mpi4py_3MPI_Distgraphcomm) __PYX_ERR(4, 131, __pyx_L1_error)
23675  __pyx_ptype_6mpi4py_3MPI_Intercomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Intercomm", sizeof(struct PyMPIIntercommObject), __Pyx_ImportType_CheckSize_Warn);
23676  if (!__pyx_ptype_6mpi4py_3MPI_Intercomm) __PYX_ERR(4, 137, __pyx_L1_error)
23677  __pyx_ptype_6mpi4py_3MPI_Win = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Win", sizeof(struct PyMPIWinObject), __Pyx_ImportType_CheckSize_Warn);
23678  if (!__pyx_ptype_6mpi4py_3MPI_Win) __PYX_ERR(4, 143, __pyx_L1_error)
23679  __pyx_ptype_6mpi4py_3MPI_File = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "File", sizeof(struct PyMPIFileObject), __Pyx_ImportType_CheckSize_Warn);
23680  if (!__pyx_ptype_6mpi4py_3MPI_File) __PYX_ERR(4, 151, __pyx_L1_error)
23681  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23682  __pyx_t_1 = PyImport_ImportModule("proteus.cmeshTools"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5, __pyx_L1_error)
23683  __Pyx_GOTREF(__pyx_t_1);
23684  __pyx_ptype_7proteus_10cmeshTools_CMesh = __Pyx_ImportType(__pyx_t_1, "proteus.cmeshTools", "CMesh", sizeof(struct __pyx_obj_7proteus_10cmeshTools_CMesh), __Pyx_ImportType_CheckSize_Warn);
23685  if (!__pyx_ptype_7proteus_10cmeshTools_CMesh) __PYX_ERR(5, 5, __pyx_L1_error)
23686  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23687  __Pyx_RefNannyFinishContext();
23688  return 0;
23689  __pyx_L1_error:;
23690  __Pyx_XDECREF(__pyx_t_1);
23691  __Pyx_RefNannyFinishContext();
23692  return -1;
23693 }
23694 
23695 static int __Pyx_modinit_variable_import_code(void) {
23696  __Pyx_RefNannyDeclarations
23697  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23698  /*--- Variable import code ---*/
23699  __Pyx_RefNannyFinishContext();
23700  return 0;
23701 }
23702 
23703 static int __Pyx_modinit_function_import_code(void) {
23704  __Pyx_RefNannyDeclarations
23705  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23706  /*--- Function import code ---*/
23707  __Pyx_RefNannyFinishContext();
23708  return 0;
23709 }
23710 
23711 
23712 #if PY_MAJOR_VERSION < 3
23713 #ifdef CYTHON_NO_PYINIT_EXPORT
23714 #define __Pyx_PyMODINIT_FUNC void
23715 #else
23716 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23717 #endif
23718 #else
23719 #ifdef CYTHON_NO_PYINIT_EXPORT
23720 #define __Pyx_PyMODINIT_FUNC PyObject *
23721 #else
23722 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23723 #endif
23724 #endif
23725 
23726 
23727 #if PY_MAJOR_VERSION < 3
23728 __Pyx_PyMODINIT_FUNC initcpartitioning(void) CYTHON_SMALL_CODE; /*proto*/
23729 __Pyx_PyMODINIT_FUNC initcpartitioning(void)
23730 #else
23731 __Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void) CYTHON_SMALL_CODE; /*proto*/
23732 __Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void)
23733 #if CYTHON_PEP489_MULTI_PHASE_INIT
23734 {
23735  return PyModuleDef_Init(&__pyx_moduledef);
23736 }
23737 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
23738  #if PY_VERSION_HEX >= 0x030700A1
23739  static PY_INT64_T main_interpreter_id = -1;
23740  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23741  if (main_interpreter_id == -1) {
23742  main_interpreter_id = current_id;
23743  return (unlikely(current_id == -1)) ? -1 : 0;
23744  } else if (unlikely(main_interpreter_id != current_id))
23745  #else
23746  static PyInterpreterState *main_interpreter = NULL;
23747  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23748  if (!main_interpreter) {
23749  main_interpreter = current_interpreter;
23750  } else if (unlikely(main_interpreter != current_interpreter))
23751  #endif
23752  {
23753  PyErr_SetString(
23754  PyExc_ImportError,
23755  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23756  return -1;
23757  }
23758  return 0;
23759 }
23760 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
23761  PyObject *value = PyObject_GetAttrString(spec, from_name);
23762  int result = 0;
23763  if (likely(value)) {
23764  if (allow_none || value != Py_None) {
23765  result = PyDict_SetItemString(moddict, to_name, value);
23766  }
23767  Py_DECREF(value);
23768  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23769  PyErr_Clear();
23770  } else {
23771  result = -1;
23772  }
23773  return result;
23774 }
23775 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23776  PyObject *module = NULL, *moddict, *modname;
23777  if (__Pyx_check_single_interpreter())
23778  return NULL;
23779  if (__pyx_m)
23780  return __Pyx_NewRef(__pyx_m);
23781  modname = PyObject_GetAttrString(spec, "name");
23782  if (unlikely(!modname)) goto bad;
23783  module = PyModule_NewObject(modname);
23784  Py_DECREF(modname);
23785  if (unlikely(!module)) goto bad;
23786  moddict = PyModule_GetDict(module);
23787  if (unlikely(!moddict)) goto bad;
23788  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
23789  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
23790  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
23791  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
23792  return module;
23793 bad:
23794  Py_XDECREF(module);
23795  return NULL;
23796 }
23797 
23798 
23799 static CYTHON_SMALL_CODE int __pyx_pymod_exec_cpartitioning(PyObject *__pyx_pyinit_module)
23800 #endif
23801 #endif
23802 {
23803  PyObject *__pyx_t_1 = NULL;
23804  PyObject *__pyx_t_2 = NULL;
23805  static PyThread_type_lock __pyx_t_3[8];
23806  __Pyx_RefNannyDeclarations
23807  #if CYTHON_PEP489_MULTI_PHASE_INIT
23808  if (__pyx_m) {
23809  if (__pyx_m == __pyx_pyinit_module) return 0;
23810  PyErr_SetString(PyExc_RuntimeError, "Module 'cpartitioning' has already been imported. Re-initialisation is not supported.");
23811  return -1;
23812  }
23813  #elif PY_MAJOR_VERSION >= 3
23814  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
23815  #endif
23816  #if CYTHON_REFNANNY
23817 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
23818 if (!__Pyx_RefNanny) {
23819  PyErr_Clear();
23820  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
23821  if (!__Pyx_RefNanny)
23822  Py_FatalError("failed to import 'refnanny' module");
23823 }
23824 #endif
23825  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void)", 0);
23826  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23827  #ifdef __Pxy_PyFrame_Initialize_Offsets
23828  __Pxy_PyFrame_Initialize_Offsets();
23829  #endif
23830  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23831  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23832  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23833  #ifdef __Pyx_CyFunction_USED
23834  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23835  #endif
23836  #ifdef __Pyx_FusedFunction_USED
23837  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23838  #endif
23839  #ifdef __Pyx_Coroutine_USED
23840  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23841  #endif
23842  #ifdef __Pyx_Generator_USED
23843  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23844  #endif
23845  #ifdef __Pyx_AsyncGen_USED
23846  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23847  #endif
23848  #ifdef __Pyx_StopAsyncIteration_USED
23849  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23850  #endif
23851  /*--- Library function declarations ---*/
23852  /*--- Threads initialization code ---*/
23853  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23854  #ifdef WITH_THREAD /* Python build with threading support? */
23855  PyEval_InitThreads();
23856  #endif
23857  #endif
23858  /*--- Module creation code ---*/
23859  #if CYTHON_PEP489_MULTI_PHASE_INIT
23860  __pyx_m = __pyx_pyinit_module;
23861  Py_INCREF(__pyx_m);
23862  #else
23863  #if PY_MAJOR_VERSION < 3
23864  __pyx_m = Py_InitModule4("cpartitioning", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23865  #else
23866  __pyx_m = PyModule_Create(&__pyx_moduledef);
23867  #endif
23868  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23869  #endif
23870  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23871  Py_INCREF(__pyx_d);
23872  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23873  Py_INCREF(__pyx_b);
23874  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23875  Py_INCREF(__pyx_cython_runtime);
23876  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23877  /*--- Initialize various global constants etc. ---*/
23878  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23879  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23880  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23881  #endif
23882  if (__pyx_module_is_main_cpartitioning) {
23883  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23884  }
23885  #if PY_MAJOR_VERSION >= 3
23886  {
23887  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23888  if (!PyDict_GetItemString(modules, "cpartitioning")) {
23889  if (unlikely(PyDict_SetItemString(modules, "cpartitioning", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23890  }
23891  }
23892  #endif
23893  /*--- Builtin init code ---*/
23894  if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
23895  /*--- Constants init code ---*/
23896  if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
23897  /*--- Global type/function init code ---*/
23898  (void)__Pyx_modinit_global_init_code();
23899  (void)__Pyx_modinit_variable_export_code();
23900  (void)__Pyx_modinit_function_export_code();
23901  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
23902  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
23903  (void)__Pyx_modinit_variable_import_code();
23904  (void)__Pyx_modinit_function_import_code();
23905  /*--- Execution code ---*/
23906  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23907  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23908  #endif
23909 
23910  /* "cpartitioning.pyx":2
23911  * # A type of -*- python -*- file
23912  * from proteus import Comm as proteus_Comm # <<<<<<<<<<<<<<
23913  * import numpy as np
23914  * cimport numpy as np
23915  */
23916  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
23917  __Pyx_GOTREF(__pyx_t_1);
23918  __Pyx_INCREF(__pyx_n_s_Comm);
23919  __Pyx_GIVEREF(__pyx_n_s_Comm);
23920  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Comm);
23921  __pyx_t_2 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error)
23922  __Pyx_GOTREF(__pyx_t_2);
23923  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23924  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Comm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
23925  __Pyx_GOTREF(__pyx_t_1);
23926  if (PyDict_SetItem(__pyx_d, __pyx_n_s_proteus_Comm, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
23927  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23928  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23929 
23930  /* "cpartitioning.pyx":3
23931  * # A type of -*- python -*- file
23932  * from proteus import Comm as proteus_Comm
23933  * import numpy as np # <<<<<<<<<<<<<<
23934  * cimport numpy as np
23935  * from mpi4py.MPI cimport (Comm,
23936  */
23937  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
23938  __Pyx_GOTREF(__pyx_t_2);
23939  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
23940  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23941 
23942  /* "cpartitioning.pyx":19
23943  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
23944  *
23945  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23946  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23947  * c_partitionElements(comm.ob_mpi,
23948  */
23949  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_1partitionElements, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
23950  __Pyx_GOTREF(__pyx_t_2);
23951  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionElements, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
23952  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23953 
23954  /* "cpartitioning.pyx":35
23955  * )
23956  *
23957  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23958  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23959  * c_partitionNodes(comm.ob_mpi,
23960  */
23961  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_3partitionNodes, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
23962  __Pyx_GOTREF(__pyx_t_2);
23963  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodes, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
23964  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23965 
23966  /* "cpartitioning.pyx":51
23967  * )
23968  *
23969  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23970  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
23971  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23972  */
23973  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
23974  __Pyx_GOTREF(__pyx_t_2);
23975  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convertPUMIPartitionToPython, __pyx_t_2) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
23976  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23977 
23978  /* "cpartitioning.pyx":65
23979  * )
23980  *
23981  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23982  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23983  * if not isinstance(filebase, bytes):
23984  */
23985  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
23986  __Pyx_GOTREF(__pyx_t_2);
23987  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodesFromTetgenFiles, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
23988  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23989 
23990  /* "cpartitioning.pyx":85
23991  * )
23992  *
23993  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23994  * int nSpace,
23995  * cmeshTools.CMesh cmesh,
23996  */
23997  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_9buildQuadraticLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
23998  __Pyx_GOTREF(__pyx_t_2);
23999  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildQuadraticLocal2GlobalMappin, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
24000  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24001 
24002  /* "cpartitioning.pyx":150
24003  * max_dof_neighbors)
24004  *
24005  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
24006  * int nSpace,
24007  * cmeshTools.CMesh cmesh,
24008  */
24009  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
24010  __Pyx_GOTREF(__pyx_t_2);
24011  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildQuadraticCubeLocal2GlobalMa, __pyx_t_2) < 0) __PYX_ERR(0, 150, __pyx_L1_error)
24012  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24013 
24014  /* "cpartitioning.pyx":191
24015  * max_dof_neighbors)
24016  *
24017  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
24018  * int nDOF_element,
24019  * cmeshTools.CMesh cmesh,
24020  */
24021  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
24022  __Pyx_GOTREF(__pyx_t_2);
24023  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildDiscontinuousGalerkinLocal2, __pyx_t_2) < 0) __PYX_ERR(0, 191, __pyx_L1_error)
24024  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24025 
24026  /* "cpartitioning.pyx":1
24027  * # A type of -*- python -*- file # <<<<<<<<<<<<<<
24028  * from proteus import Comm as proteus_Comm
24029  * import numpy as np
24030  */
24031  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
24032  __Pyx_GOTREF(__pyx_t_2);
24033  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24034  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24035 
24036  /* "View.MemoryView":209
24037  * info.obj = self
24038  *
24039  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24040  *
24041  * def __dealloc__(array self):
24042  */
24043  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 209, __pyx_L1_error)
24044  __Pyx_GOTREF(__pyx_t_2);
24045  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 209, __pyx_L1_error)
24046  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24047  PyType_Modified(__pyx_array_type);
24048 
24049  /* "View.MemoryView":286
24050  * return self.name
24051  *
24052  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
24053  * cdef strided = Enum("<strided and direct>") # default
24054  * cdef indirect = Enum("<strided and indirect>")
24055  */
24056  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 286, __pyx_L1_error)
24057  __Pyx_GOTREF(__pyx_t_2);
24058  __Pyx_XGOTREF(generic);
24059  __Pyx_DECREF_SET(generic, __pyx_t_2);
24060  __Pyx_GIVEREF(__pyx_t_2);
24061  __pyx_t_2 = 0;
24062 
24063  /* "View.MemoryView":287
24064  *
24065  * cdef generic = Enum("<strided and direct or indirect>")
24066  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
24067  * cdef indirect = Enum("<strided and indirect>")
24068  *
24069  */
24070  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error)
24071  __Pyx_GOTREF(__pyx_t_2);
24072  __Pyx_XGOTREF(strided);
24073  __Pyx_DECREF_SET(strided, __pyx_t_2);
24074  __Pyx_GIVEREF(__pyx_t_2);
24075  __pyx_t_2 = 0;
24076 
24077  /* "View.MemoryView":288
24078  * cdef generic = Enum("<strided and direct or indirect>")
24079  * cdef strided = Enum("<strided and direct>") # default
24080  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
24081  *
24082  *
24083  */
24084  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 288, __pyx_L1_error)
24085  __Pyx_GOTREF(__pyx_t_2);
24086  __Pyx_XGOTREF(indirect);
24087  __Pyx_DECREF_SET(indirect, __pyx_t_2);
24088  __Pyx_GIVEREF(__pyx_t_2);
24089  __pyx_t_2 = 0;
24090 
24091  /* "View.MemoryView":291
24092  *
24093  *
24094  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
24095  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
24096  *
24097  */
24098  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 291, __pyx_L1_error)
24099  __Pyx_GOTREF(__pyx_t_2);
24100  __Pyx_XGOTREF(contiguous);
24101  __Pyx_DECREF_SET(contiguous, __pyx_t_2);
24102  __Pyx_GIVEREF(__pyx_t_2);
24103  __pyx_t_2 = 0;
24104 
24105  /* "View.MemoryView":292
24106  *
24107  * cdef contiguous = Enum("<contiguous and direct>")
24108  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
24109  *
24110  *
24111  */
24112  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 292, __pyx_L1_error)
24113  __Pyx_GOTREF(__pyx_t_2);
24114  __Pyx_XGOTREF(indirect_contiguous);
24115  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
24116  __Pyx_GIVEREF(__pyx_t_2);
24117  __pyx_t_2 = 0;
24118 
24119  /* "View.MemoryView":316
24120  *
24121  * DEF THREAD_LOCKS_PREALLOCATED = 8
24122  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
24123  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
24124  * PyThread_allocate_lock(),
24125  */
24126  __pyx_memoryview_thread_locks_used = 0;
24127 
24128  /* "View.MemoryView":317
24129  * DEF THREAD_LOCKS_PREALLOCATED = 8
24130  * cdef int __pyx_memoryview_thread_locks_used = 0
24131  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
24132  * PyThread_allocate_lock(),
24133  * PyThread_allocate_lock(),
24134  */
24135  __pyx_t_3[0] = PyThread_allocate_lock();
24136  __pyx_t_3[1] = PyThread_allocate_lock();
24137  __pyx_t_3[2] = PyThread_allocate_lock();
24138  __pyx_t_3[3] = PyThread_allocate_lock();
24139  __pyx_t_3[4] = PyThread_allocate_lock();
24140  __pyx_t_3[5] = PyThread_allocate_lock();
24141  __pyx_t_3[6] = PyThread_allocate_lock();
24142  __pyx_t_3[7] = PyThread_allocate_lock();
24143  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
24144 
24145  /* "View.MemoryView":549
24146  * info.obj = self
24147  *
24148  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24149  *
24150  *
24151  */
24152  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 549, __pyx_L1_error)
24153  __Pyx_GOTREF(__pyx_t_2);
24154  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 549, __pyx_L1_error)
24155  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24156  PyType_Modified(__pyx_memoryview_type);
24157 
24158  /* "View.MemoryView":995
24159  * return self.from_object
24160  *
24161  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24162  *
24163  *
24164  */
24165  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 995, __pyx_L1_error)
24166  __Pyx_GOTREF(__pyx_t_2);
24167  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 995, __pyx_L1_error)
24168  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24169  PyType_Modified(__pyx_memoryviewslice_type);
24170 
24171  /* "(tree fragment)":1
24172  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
24173  * cdef object __pyx_PickleError
24174  * cdef object __pyx_result
24175  */
24176  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
24177  __Pyx_GOTREF(__pyx_t_2);
24178  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
24179  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24180 
24181  /* "BufferFormatFromTypeInfo":1463
24182  *
24183  * @cname('__pyx_format_from_typeinfo')
24184  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
24185  * cdef __Pyx_StructField *field
24186  * cdef __pyx_typeinfo_string fmt
24187  */
24188 
24189  /*--- Wrapped vars code ---*/
24190 
24191  goto __pyx_L0;
24192  __pyx_L1_error:;
24193  __Pyx_XDECREF(__pyx_t_1);
24194  __Pyx_XDECREF(__pyx_t_2);
24195  if (__pyx_m) {
24196  if (__pyx_d) {
24197  __Pyx_AddTraceback("init cpartitioning", __pyx_clineno, __pyx_lineno, __pyx_filename);
24198  }
24199  Py_CLEAR(__pyx_m);
24200  } else if (!PyErr_Occurred()) {
24201  PyErr_SetString(PyExc_ImportError, "init cpartitioning");
24202  }
24203  __pyx_L0:;
24204  __Pyx_RefNannyFinishContext();
24205  #if CYTHON_PEP489_MULTI_PHASE_INIT
24206  return (__pyx_m != NULL) ? 0 : -1;
24207  #elif PY_MAJOR_VERSION >= 3
24208  return __pyx_m;
24209  #else
24210  return;
24211  #endif
24212 }
24213 
24214 /* --- Runtime support code --- */
24215 /* Refnanny */
24216 #if CYTHON_REFNANNY
24217 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
24218  PyObject *m = NULL, *p = NULL;
24219  void *r = NULL;
24220  m = PyImport_ImportModule(modname);
24221  if (!m) goto end;
24222  p = PyObject_GetAttrString(m, "RefNannyAPI");
24223  if (!p) goto end;
24224  r = PyLong_AsVoidPtr(p);
24225 end:
24226  Py_XDECREF(p);
24227  Py_XDECREF(m);
24228  return (__Pyx_RefNannyAPIStruct *)r;
24229 }
24230 #endif
24231 
24232 /* RaiseArgTupleInvalid */
24233 static void __Pyx_RaiseArgtupleInvalid(
24234  const char* func_name,
24235  int exact,
24236  Py_ssize_t num_min,
24237  Py_ssize_t num_max,
24238  Py_ssize_t num_found)
24239 {
24240  Py_ssize_t num_expected;
24241  const char *more_or_less;
24242  if (num_found < num_min) {
24243  num_expected = num_min;
24244  more_or_less = "at least";
24245  } else {
24246  num_expected = num_max;
24247  more_or_less = "at most";
24248  }
24249  if (exact) {
24250  more_or_less = "exactly";
24251  }
24252  PyErr_Format(PyExc_TypeError,
24253  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
24254  func_name, more_or_less, num_expected,
24255  (num_expected == 1) ? "" : "s", num_found);
24256 }
24257 
24258 /* RaiseDoubleKeywords */
24259 static void __Pyx_RaiseDoubleKeywordsError(
24260  const char* func_name,
24261  PyObject* kw_name)
24262 {
24263  PyErr_Format(PyExc_TypeError,
24264  #if PY_MAJOR_VERSION >= 3
24265  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24266  #else
24267  "%s() got multiple values for keyword argument '%s'", func_name,
24268  PyString_AsString(kw_name));
24269  #endif
24270 }
24271 
24272 /* ParseKeywords */
24273 static int __Pyx_ParseOptionalKeywords(
24274  PyObject *kwds,
24275  PyObject **argnames[],
24276  PyObject *kwds2,
24277  PyObject *values[],
24278  Py_ssize_t num_pos_args,
24279  const char* function_name)
24280 {
24281  PyObject *key = 0, *value = 0;
24282  Py_ssize_t pos = 0;
24283  PyObject*** name;
24284  PyObject*** first_kw_arg = argnames + num_pos_args;
24285  while (PyDict_Next(kwds, &pos, &key, &value)) {
24286  name = first_kw_arg;
24287  while (*name && (**name != key)) name++;
24288  if (*name) {
24289  values[name-argnames] = value;
24290  continue;
24291  }
24292  name = first_kw_arg;
24293  #if PY_MAJOR_VERSION < 3
24294  if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
24295  while (*name) {
24296  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24297  && _PyString_Eq(**name, key)) {
24298  values[name-argnames] = value;
24299  break;
24300  }
24301  name++;
24302  }
24303  if (*name) continue;
24304  else {
24305  PyObject*** argname = argnames;
24306  while (argname != first_kw_arg) {
24307  if ((**argname == key) || (
24308  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24309  && _PyString_Eq(**argname, key))) {
24310  goto arg_passed_twice;
24311  }
24312  argname++;
24313  }
24314  }
24315  } else
24316  #endif
24317  if (likely(PyUnicode_Check(key))) {
24318  while (*name) {
24319  int cmp = (**name == key) ? 0 :
24320  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24321  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
24322  #endif
24323  PyUnicode_Compare(**name, key);
24324  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24325  if (cmp == 0) {
24326  values[name-argnames] = value;
24327  break;
24328  }
24329  name++;
24330  }
24331  if (*name) continue;
24332  else {
24333  PyObject*** argname = argnames;
24334  while (argname != first_kw_arg) {
24335  int cmp = (**argname == key) ? 0 :
24336  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24337  (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
24338  #endif
24339  PyUnicode_Compare(**argname, key);
24340  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24341  if (cmp == 0) goto arg_passed_twice;
24342  argname++;
24343  }
24344  }
24345  } else
24346  goto invalid_keyword_type;
24347  if (kwds2) {
24348  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
24349  } else {
24350  goto invalid_keyword;
24351  }
24352  }
24353  return 0;
24354 arg_passed_twice:
24355  __Pyx_RaiseDoubleKeywordsError(function_name, key);
24356  goto bad;
24357 invalid_keyword_type:
24358  PyErr_Format(PyExc_TypeError,
24359  "%.200s() keywords must be strings", function_name);
24360  goto bad;
24361 invalid_keyword:
24362  PyErr_Format(PyExc_TypeError,
24363  #if PY_MAJOR_VERSION < 3
24364  "%.200s() got an unexpected keyword argument '%.200s'",
24365  function_name, PyString_AsString(key));
24366  #else
24367  "%s() got an unexpected keyword argument '%U'",
24368  function_name, key);
24369  #endif
24370 bad:
24371  return -1;
24372 }
24373 
24374 /* ArgTypeTest */
24375 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
24376 {
24377  if (unlikely(!type)) {
24378  PyErr_SetString(PyExc_SystemError, "Missing type object");
24379  return 0;
24380  }
24381  else if (exact) {
24382  #if PY_MAJOR_VERSION == 2
24383  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
24384  #endif
24385  }
24386  else {
24387  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
24388  }
24389  PyErr_Format(PyExc_TypeError,
24390  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24391  name, type->tp_name, Py_TYPE(obj)->tp_name);
24392  return 0;
24393 }
24394 
24395 /* PyObjectGetAttrStr */
24396 #if CYTHON_USE_TYPE_SLOTS
24397 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24398  PyTypeObject* tp = Py_TYPE(obj);
24399  if (likely(tp->tp_getattro))
24400  return tp->tp_getattro(obj, attr_name);
24401 #if PY_MAJOR_VERSION < 3
24402  if (likely(tp->tp_getattr))
24403  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24404 #endif
24405  return PyObject_GetAttr(obj, attr_name);
24406 }
24407 #endif
24408 
24409 /* GetBuiltinName */
24410 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24411  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24412  if (unlikely(!result)) {
24413  PyErr_Format(PyExc_NameError,
24414 #if PY_MAJOR_VERSION >= 3
24415  "name '%U' is not defined", name);
24416 #else
24417  "name '%.200s' is not defined", PyString_AS_STRING(name));
24418 #endif
24419  }
24420  return result;
24421 }
24422 
24423 /* PyDictVersioning */
24424 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24425 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24426  PyObject *dict = Py_TYPE(obj)->tp_dict;
24427  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24428 }
24429 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24430  PyObject **dictptr = NULL;
24431  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24432  if (offset) {
24433 #if CYTHON_COMPILING_IN_CPYTHON
24434  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
24435 #else
24436  dictptr = _PyObject_GetDictPtr(obj);
24437 #endif
24438  }
24439  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24440 }
24441 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24442  PyObject *dict = Py_TYPE(obj)->tp_dict;
24443  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24444  return 0;
24445  return obj_dict_version == __Pyx_get_object_dict_version(obj);
24446 }
24447 #endif
24448 
24449 /* GetModuleGlobalName */
24450 #if CYTHON_USE_DICT_VERSIONS
24451 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24452 #else
24453 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24454 #endif
24455 {
24456  PyObject *result;
24457 #if !CYTHON_AVOID_BORROWED_REFS
24458 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24459  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24460  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24461  if (likely(result)) {
24462  return __Pyx_NewRef(result);
24463  } else if (unlikely(PyErr_Occurred())) {
24464  return NULL;
24465  }
24466 #else
24467  result = PyDict_GetItem(__pyx_d, name);
24468  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24469  if (likely(result)) {
24470  return __Pyx_NewRef(result);
24471  }
24472 #endif
24473 #else
24474  result = PyObject_GetItem(__pyx_d, name);
24475  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24476  if (likely(result)) {
24477  return __Pyx_NewRef(result);
24478  }
24479  PyErr_Clear();
24480 #endif
24481  return __Pyx_GetBuiltinName(name);
24482 }
24483 
24484 /* PyIntBinop */
24485 #if !CYTHON_COMPILING_IN_PYPY
24486 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
24487  (void)inplace;
24488  (void)zerodivision_check;
24489  #if PY_MAJOR_VERSION < 3
24490  if (likely(PyInt_CheckExact(op1))) {
24491  const long b = intval;
24492  long x;
24493  long a = PyInt_AS_LONG(op1);
24494  x = (long)((unsigned long)a + b);
24495  if (likely((x^a) >= 0 || (x^b) >= 0))
24496  return PyInt_FromLong(x);
24497  return PyLong_Type.tp_as_number->nb_add(op1, op2);
24498  }
24499  #endif
24500  #if CYTHON_USE_PYLONG_INTERNALS
24501  if (likely(PyLong_CheckExact(op1))) {
24502  const long b = intval;
24503  long a, x;
24504 #ifdef HAVE_LONG_LONG
24505  const PY_LONG_LONG llb = intval;
24506  PY_LONG_LONG lla, llx;
24507 #endif
24508  const digit* digits = ((PyLongObject*)op1)->ob_digit;
24509  const Py_ssize_t size = Py_SIZE(op1);
24510  if (likely(__Pyx_sst_abs(size) <= 1)) {
24511  a = likely(size) ? digits[0] : 0;
24512  if (size == -1) a = -a;
24513  } else {
24514  switch (size) {
24515  case -2:
24516  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24517  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24518  break;
24519 #ifdef HAVE_LONG_LONG
24520  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24521  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24522  goto long_long;
24523 #endif
24524  }
24525  CYTHON_FALLTHROUGH;
24526  case 2:
24527  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24528  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24529  break;
24530 #ifdef HAVE_LONG_LONG
24531  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24532  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24533  goto long_long;
24534 #endif
24535  }
24536  CYTHON_FALLTHROUGH;
24537  case -3:
24538  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24539  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24540  break;
24541 #ifdef HAVE_LONG_LONG
24542  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24543  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24544  goto long_long;
24545 #endif
24546  }
24547  CYTHON_FALLTHROUGH;
24548  case 3:
24549  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24550  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24551  break;
24552 #ifdef HAVE_LONG_LONG
24553  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24554  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24555  goto long_long;
24556 #endif
24557  }
24558  CYTHON_FALLTHROUGH;
24559  case -4:
24560  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24561  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24562  break;
24563 #ifdef HAVE_LONG_LONG
24564  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24565  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24566  goto long_long;
24567 #endif
24568  }
24569  CYTHON_FALLTHROUGH;
24570  case 4:
24571  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24572  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24573  break;
24574 #ifdef HAVE_LONG_LONG
24575  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24576  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24577  goto long_long;
24578 #endif
24579  }
24580  CYTHON_FALLTHROUGH;
24581  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
24582  }
24583  }
24584  x = a + b;
24585  return PyLong_FromLong(x);
24586 #ifdef HAVE_LONG_LONG
24587  long_long:
24588  llx = lla + llb;
24589  return PyLong_FromLongLong(llx);
24590 #endif
24591 
24592 
24593  }
24594  #endif
24595  if (PyFloat_CheckExact(op1)) {
24596  const long b = intval;
24597  double a = PyFloat_AS_DOUBLE(op1);
24598  double result;
24599  PyFPE_START_PROTECT("add", return NULL)
24600  result = ((double)a) + (double)b;
24601  PyFPE_END_PROTECT(result)
24602  return PyFloat_FromDouble(result);
24603  }
24604  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24605 }
24606 #endif
24607 
24608 /* PyCFunctionFastCall */
24609 #if CYTHON_FAST_PYCCALL
24610 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24611  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24612  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24613  PyObject *self = PyCFunction_GET_SELF(func);
24614  int flags = PyCFunction_GET_FLAGS(func);
24615  assert(PyCFunction_Check(func));
24616  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24617  assert(nargs >= 0);
24618  assert(nargs == 0 || args != NULL);
24619  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24620  because it may clear it (directly or indirectly) and so the
24621  caller loses its exception */
24622  assert(!PyErr_Occurred());
24623  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24624  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
24625  } else {
24626  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
24627  }
24628 }
24629 #endif
24630 
24631 /* PyFunctionFastCall */
24632 #if CYTHON_FAST_PYCALL
24633 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24634  PyObject *globals) {
24635  PyFrameObject *f;
24636  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24637  PyObject **fastlocals;
24638  Py_ssize_t i;
24639  PyObject *result;
24640  assert(globals != NULL);
24641  /* XXX Perhaps we should create a specialized
24642  PyFrame_New() that doesn't take locals, but does
24643  take builtins without sanity checking them.
24644  */
24645  assert(tstate != NULL);
24646  f = PyFrame_New(tstate, co, globals, NULL);
24647  if (f == NULL) {
24648  return NULL;
24649  }
24650  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24651  for (i = 0; i < na; i++) {
24652  Py_INCREF(*args);
24653  fastlocals[i] = *args++;
24654  }
24655  result = PyEval_EvalFrameEx(f,0);
24656  ++tstate->recursion_depth;
24657  Py_DECREF(f);
24658  --tstate->recursion_depth;
24659  return result;
24660 }
24661 #if 1 || PY_VERSION_HEX < 0x030600B1
24662 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24663  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24664  PyObject *globals = PyFunction_GET_GLOBALS(func);
24665  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24666  PyObject *closure;
24667 #if PY_MAJOR_VERSION >= 3
24668  PyObject *kwdefs;
24669 #endif
24670  PyObject *kwtuple, **k;
24671  PyObject **d;
24672  Py_ssize_t nd;
24673  Py_ssize_t nk;
24674  PyObject *result;
24675  assert(kwargs == NULL || PyDict_Check(kwargs));
24676  nk = kwargs ? PyDict_Size(kwargs) : 0;
24677  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24678  return NULL;
24679  }
24680  if (
24681 #if PY_MAJOR_VERSION >= 3
24682  co->co_kwonlyargcount == 0 &&
24683 #endif
24684  likely(kwargs == NULL || nk == 0) &&
24685  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24686  if (argdefs == NULL && co->co_argcount == nargs) {
24687  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24688  goto done;
24689  }
24690  else if (nargs == 0 && argdefs != NULL
24691  && co->co_argcount == Py_SIZE(argdefs)) {
24692  /* function called with no arguments, but all parameters have
24693  a default value: use default values as arguments .*/
24694  args = &PyTuple_GET_ITEM(argdefs, 0);
24695  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24696  goto done;
24697  }
24698  }
24699  if (kwargs != NULL) {
24700  Py_ssize_t pos, i;
24701  kwtuple = PyTuple_New(2 * nk);
24702  if (kwtuple == NULL) {
24703  result = NULL;
24704  goto done;
24705  }
24706  k = &PyTuple_GET_ITEM(kwtuple, 0);
24707  pos = i = 0;
24708  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24709  Py_INCREF(k[i]);
24710  Py_INCREF(k[i+1]);
24711  i += 2;
24712  }
24713  nk = i / 2;
24714  }
24715  else {
24716  kwtuple = NULL;
24717  k = NULL;
24718  }
24719  closure = PyFunction_GET_CLOSURE(func);
24720 #if PY_MAJOR_VERSION >= 3
24721  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24722 #endif
24723  if (argdefs != NULL) {
24724  d = &PyTuple_GET_ITEM(argdefs, 0);
24725  nd = Py_SIZE(argdefs);
24726  }
24727  else {
24728  d = NULL;
24729  nd = 0;
24730  }
24731 #if PY_MAJOR_VERSION >= 3
24732  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24733  args, (int)nargs,
24734  k, (int)nk,
24735  d, (int)nd, kwdefs, closure);
24736 #else
24737  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24738  args, (int)nargs,
24739  k, (int)nk,
24740  d, (int)nd, closure);
24741 #endif
24742  Py_XDECREF(kwtuple);
24743 done:
24744  Py_LeaveRecursiveCall();
24745  return result;
24746 }
24747 #endif
24748 #endif
24749 
24750 /* PyObjectCall */
24751 #if CYTHON_COMPILING_IN_CPYTHON
24752 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24753  PyObject *result;
24754  ternaryfunc call = func->ob_type->tp_call;
24755  if (unlikely(!call))
24756  return PyObject_Call(func, arg, kw);
24757  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24758  return NULL;
24759  result = (*call)(func, arg, kw);
24760  Py_LeaveRecursiveCall();
24761  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24762  PyErr_SetString(
24763  PyExc_SystemError,
24764  "NULL result without error in PyObject_Call");
24765  }
24766  return result;
24767 }
24768 #endif
24769 
24770 /* PyObjectCall2Args */
24771 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
24772  PyObject *args, *result = NULL;
24773  #if CYTHON_FAST_PYCALL
24774  if (PyFunction_Check(function)) {
24775  PyObject *args[2] = {arg1, arg2};
24776  return __Pyx_PyFunction_FastCall(function, args, 2);
24777  }
24778  #endif
24779  #if CYTHON_FAST_PYCCALL
24780  if (__Pyx_PyFastCFunction_Check(function)) {
24781  PyObject *args[2] = {arg1, arg2};
24782  return __Pyx_PyCFunction_FastCall(function, args, 2);
24783  }
24784  #endif
24785  args = PyTuple_New(2);
24786  if (unlikely(!args)) goto done;
24787  Py_INCREF(arg1);
24788  PyTuple_SET_ITEM(args, 0, arg1);
24789  Py_INCREF(arg2);
24790  PyTuple_SET_ITEM(args, 1, arg2);
24791  Py_INCREF(function);
24792  result = __Pyx_PyObject_Call(function, args, NULL);
24793  Py_DECREF(args);
24794  Py_DECREF(function);
24795 done:
24796  return result;
24797 }
24798 
24799 /* PyObjectCallMethO */
24800 #if CYTHON_COMPILING_IN_CPYTHON
24801 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24802  PyObject *self, *result;
24803  PyCFunction cfunc;
24804  cfunc = PyCFunction_GET_FUNCTION(func);
24805  self = PyCFunction_GET_SELF(func);
24806  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24807  return NULL;
24808  result = cfunc(self, arg);
24809  Py_LeaveRecursiveCall();
24810  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24811  PyErr_SetString(
24812  PyExc_SystemError,
24813  "NULL result without error in PyObject_Call");
24814  }
24815  return result;
24816 }
24817 #endif
24818 
24819 /* PyObjectCallOneArg */
24820 #if CYTHON_COMPILING_IN_CPYTHON
24821 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24822  PyObject *result;
24823  PyObject *args = PyTuple_New(1);
24824  if (unlikely(!args)) return NULL;
24825  Py_INCREF(arg);
24826  PyTuple_SET_ITEM(args, 0, arg);
24827  result = __Pyx_PyObject_Call(func, args, NULL);
24828  Py_DECREF(args);
24829  return result;
24830 }
24831 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24832 #if CYTHON_FAST_PYCALL
24833  if (PyFunction_Check(func)) {
24834  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24835  }
24836 #endif
24837  if (likely(PyCFunction_Check(func))) {
24838  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24839  return __Pyx_PyObject_CallMethO(func, arg);
24840 #if CYTHON_FAST_PYCCALL
24841  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24842  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24843 #endif
24844  }
24845  }
24846  return __Pyx__PyObject_CallOneArg(func, arg);
24847 }
24848 #else
24849 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24850  PyObject *result;
24851  PyObject *args = PyTuple_Pack(1, arg);
24852  if (unlikely(!args)) return NULL;
24853  result = __Pyx_PyObject_Call(func, args, NULL);
24854  Py_DECREF(args);
24855  return result;
24856 }
24857 #endif
24858 
24859 /* PyObjectCallNoArg */
24860 #if CYTHON_COMPILING_IN_CPYTHON
24861 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24862 #if CYTHON_FAST_PYCALL
24863  if (PyFunction_Check(func)) {
24864  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24865  }
24866 #endif
24867 #ifdef __Pyx_CyFunction_USED
24868  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24869 #else
24870  if (likely(PyCFunction_Check(func)))
24871 #endif
24872  {
24873  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24874  return __Pyx_PyObject_CallMethO(func, NULL);
24875  }
24876  }
24877  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24878 }
24879 #endif
24880 
24881 /* PyErrFetchRestore */
24882 #if CYTHON_FAST_THREAD_STATE
24883 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24884  PyObject *tmp_type, *tmp_value, *tmp_tb;
24885  tmp_type = tstate->curexc_type;
24886  tmp_value = tstate->curexc_value;
24887  tmp_tb = tstate->curexc_traceback;
24888  tstate->curexc_type = type;
24889  tstate->curexc_value = value;
24890  tstate->curexc_traceback = tb;
24891  Py_XDECREF(tmp_type);
24892  Py_XDECREF(tmp_value);
24893  Py_XDECREF(tmp_tb);
24894 }
24895 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24896  *type = tstate->curexc_type;
24897  *value = tstate->curexc_value;
24898  *tb = tstate->curexc_traceback;
24899  tstate->curexc_type = 0;
24900  tstate->curexc_value = 0;
24901  tstate->curexc_traceback = 0;
24902 }
24903 #endif
24904 
24905 /* RaiseException */
24906 #if PY_MAJOR_VERSION < 3
24907 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24908  CYTHON_UNUSED PyObject *cause) {
24909  __Pyx_PyThreadState_declare
24910  Py_XINCREF(type);
24911  if (!value || value == Py_None)
24912  value = NULL;
24913  else
24914  Py_INCREF(value);
24915  if (!tb || tb == Py_None)
24916  tb = NULL;
24917  else {
24918  Py_INCREF(tb);
24919  if (!PyTraceBack_Check(tb)) {
24920  PyErr_SetString(PyExc_TypeError,
24921  "raise: arg 3 must be a traceback or None");
24922  goto raise_error;
24923  }
24924  }
24925  if (PyType_Check(type)) {
24926 #if CYTHON_COMPILING_IN_PYPY
24927  if (!value) {
24928  Py_INCREF(Py_None);
24929  value = Py_None;
24930  }
24931 #endif
24932  PyErr_NormalizeException(&type, &value, &tb);
24933  } else {
24934  if (value) {
24935  PyErr_SetString(PyExc_TypeError,
24936  "instance exception may not have a separate value");
24937  goto raise_error;
24938  }
24939  value = type;
24940  type = (PyObject*) Py_TYPE(type);
24941  Py_INCREF(type);
24942  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24943  PyErr_SetString(PyExc_TypeError,
24944  "raise: exception class must be a subclass of BaseException");
24945  goto raise_error;
24946  }
24947  }
24948  __Pyx_PyThreadState_assign
24949  __Pyx_ErrRestore(type, value, tb);
24950  return;
24951 raise_error:
24952  Py_XDECREF(value);
24953  Py_XDECREF(type);
24954  Py_XDECREF(tb);
24955  return;
24956 }
24957 #else
24958 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24959  PyObject* owned_instance = NULL;
24960  if (tb == Py_None) {
24961  tb = 0;
24962  } else if (tb && !PyTraceBack_Check(tb)) {
24963  PyErr_SetString(PyExc_TypeError,
24964  "raise: arg 3 must be a traceback or None");
24965  goto bad;
24966  }
24967  if (value == Py_None)
24968  value = 0;
24969  if (PyExceptionInstance_Check(type)) {
24970  if (value) {
24971  PyErr_SetString(PyExc_TypeError,
24972  "instance exception may not have a separate value");
24973  goto bad;
24974  }
24975  value = type;
24976  type = (PyObject*) Py_TYPE(value);
24977  } else if (PyExceptionClass_Check(type)) {
24978  PyObject *instance_class = NULL;
24979  if (value && PyExceptionInstance_Check(value)) {
24980  instance_class = (PyObject*) Py_TYPE(value);
24981  if (instance_class != type) {
24982  int is_subclass = PyObject_IsSubclass(instance_class, type);
24983  if (!is_subclass) {
24984  instance_class = NULL;
24985  } else if (unlikely(is_subclass == -1)) {
24986  goto bad;
24987  } else {
24988  type = instance_class;
24989  }
24990  }
24991  }
24992  if (!instance_class) {
24993  PyObject *args;
24994  if (!value)
24995  args = PyTuple_New(0);
24996  else if (PyTuple_Check(value)) {
24997  Py_INCREF(value);
24998  args = value;
24999  } else
25000  args = PyTuple_Pack(1, value);
25001  if (!args)
25002  goto bad;
25003  owned_instance = PyObject_Call(type, args, NULL);
25004  Py_DECREF(args);
25005  if (!owned_instance)
25006  goto bad;
25007  value = owned_instance;
25008  if (!PyExceptionInstance_Check(value)) {
25009  PyErr_Format(PyExc_TypeError,
25010  "calling %R should have returned an instance of "
25011  "BaseException, not %R",
25012  type, Py_TYPE(value));
25013  goto bad;
25014  }
25015  }
25016  } else {
25017  PyErr_SetString(PyExc_TypeError,
25018  "raise: exception class must be a subclass of BaseException");
25019  goto bad;
25020  }
25021  if (cause) {
25022  PyObject *fixed_cause;
25023  if (cause == Py_None) {
25024  fixed_cause = NULL;
25025  } else if (PyExceptionClass_Check(cause)) {
25026  fixed_cause = PyObject_CallObject(cause, NULL);
25027  if (fixed_cause == NULL)
25028  goto bad;
25029  } else if (PyExceptionInstance_Check(cause)) {
25030  fixed_cause = cause;
25031  Py_INCREF(fixed_cause);
25032  } else {
25033  PyErr_SetString(PyExc_TypeError,
25034  "exception causes must derive from "
25035  "BaseException");
25036  goto bad;
25037  }
25038  PyException_SetCause(value, fixed_cause);
25039  }
25040  PyErr_SetObject(type, value);
25041  if (tb) {
25042 #if CYTHON_COMPILING_IN_PYPY
25043  PyObject *tmp_type, *tmp_value, *tmp_tb;
25044  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25045  Py_INCREF(tb);
25046  PyErr_Restore(tmp_type, tmp_value, tb);
25047  Py_XDECREF(tmp_tb);
25048 #else
25049  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25050  PyObject* tmp_tb = tstate->curexc_traceback;
25051  if (tb != tmp_tb) {
25052  Py_INCREF(tb);
25053  tstate->curexc_traceback = tb;
25054  Py_XDECREF(tmp_tb);
25055  }
25056 #endif
25057  }
25058 bad:
25059  Py_XDECREF(owned_instance);
25060  return;
25061 }
25062 #endif
25063 
25064 /* DictGetItem */
25065 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
25066 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
25067  PyObject *value;
25068  value = PyDict_GetItemWithError(d, key);
25069  if (unlikely(!value)) {
25070  if (!PyErr_Occurred()) {
25071  if (unlikely(PyTuple_Check(key))) {
25072  PyObject* args = PyTuple_Pack(1, key);
25073  if (likely(args)) {
25074  PyErr_SetObject(PyExc_KeyError, args);
25075  Py_DECREF(args);
25076  }
25077  } else {
25078  PyErr_SetObject(PyExc_KeyError, key);
25079  }
25080  }
25081  return NULL;
25082  }
25083  Py_INCREF(value);
25084  return value;
25085 }
25086 #endif
25087 
25088 /* RaiseTooManyValuesToUnpack */
25089 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25090  PyErr_Format(PyExc_ValueError,
25091  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
25092 }
25093 
25094 /* RaiseNeedMoreValuesToUnpack */
25095 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25096  PyErr_Format(PyExc_ValueError,
25097  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
25098  index, (index == 1) ? "" : "s");
25099 }
25100 
25101 /* RaiseNoneIterError */
25102 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
25103  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
25104 }
25105 
25106 /* ExtTypeTest */
25107 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25108  if (unlikely(!type)) {
25109  PyErr_SetString(PyExc_SystemError, "Missing type object");
25110  return 0;
25111  }
25112  if (likely(__Pyx_TypeCheck(obj, type)))
25113  return 1;
25114  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
25115  Py_TYPE(obj)->tp_name, type->tp_name);
25116  return 0;
25117 }
25118 
25119 /* GetTopmostException */
25120 #if CYTHON_USE_EXC_INFO_STACK
25121 static _PyErr_StackItem *
25122 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
25123 {
25124  _PyErr_StackItem *exc_info = tstate->exc_info;
25125  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
25126  exc_info->previous_item != NULL)
25127  {
25128  exc_info = exc_info->previous_item;
25129  }
25130  return exc_info;
25131 }
25132 #endif
25133 
25134 /* SaveResetException */
25135 #if CYTHON_FAST_THREAD_STATE
25136 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25137  #if CYTHON_USE_EXC_INFO_STACK
25138  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
25139  *type = exc_info->exc_type;
25140  *value = exc_info->exc_value;
25141  *tb = exc_info->exc_traceback;
25142  #else
25143  *type = tstate->exc_type;
25144  *value = tstate->exc_value;
25145  *tb = tstate->exc_traceback;
25146  #endif
25147  Py_XINCREF(*type);
25148  Py_XINCREF(*value);
25149  Py_XINCREF(*tb);
25150 }
25151 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25152  PyObject *tmp_type, *tmp_value, *tmp_tb;
25153  #if CYTHON_USE_EXC_INFO_STACK
25154  _PyErr_StackItem *exc_info = tstate->exc_info;
25155  tmp_type = exc_info->exc_type;
25156  tmp_value = exc_info->exc_value;
25157  tmp_tb = exc_info->exc_traceback;
25158  exc_info->exc_type = type;
25159  exc_info->exc_value = value;
25160  exc_info->exc_traceback = tb;
25161  #else
25162  tmp_type = tstate->exc_type;
25163  tmp_value = tstate->exc_value;
25164  tmp_tb = tstate->exc_traceback;
25165  tstate->exc_type = type;
25166  tstate->exc_value = value;
25167  tstate->exc_traceback = tb;
25168  #endif
25169  Py_XDECREF(tmp_type);
25170  Py_XDECREF(tmp_value);
25171  Py_XDECREF(tmp_tb);
25172 }
25173 #endif
25174 
25175 /* PyErrExceptionMatches */
25176 #if CYTHON_FAST_THREAD_STATE
25177 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25178  Py_ssize_t i, n;
25179  n = PyTuple_GET_SIZE(tuple);
25180 #if PY_MAJOR_VERSION >= 3
25181  for (i=0; i<n; i++) {
25182  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25183  }
25184 #endif
25185  for (i=0; i<n; i++) {
25186  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
25187  }
25188  return 0;
25189 }
25190 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25191  PyObject *exc_type = tstate->curexc_type;
25192  if (exc_type == err) return 1;
25193  if (unlikely(!exc_type)) return 0;
25194  if (unlikely(PyTuple_Check(err)))
25195  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25196  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25197 }
25198 #endif
25199 
25200 /* GetException */
25201 #if CYTHON_FAST_THREAD_STATE
25202 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25203 #else
25204 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25205 #endif
25206 {
25207  PyObject *local_type, *local_value, *local_tb;
25208 #if CYTHON_FAST_THREAD_STATE
25209  PyObject *tmp_type, *tmp_value, *tmp_tb;
25210  local_type = tstate->curexc_type;
25211  local_value = tstate->curexc_value;
25212  local_tb = tstate->curexc_traceback;
25213  tstate->curexc_type = 0;
25214  tstate->curexc_value = 0;
25215  tstate->curexc_traceback = 0;
25216 #else
25217  PyErr_Fetch(&local_type, &local_value, &local_tb);
25218 #endif
25219  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25220 #if CYTHON_FAST_THREAD_STATE
25221  if (unlikely(tstate->curexc_type))
25222 #else
25223  if (unlikely(PyErr_Occurred()))
25224 #endif
25225  goto bad;
25226  #if PY_MAJOR_VERSION >= 3
25227  if (local_tb) {
25228  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25229  goto bad;
25230  }
25231  #endif
25232  Py_XINCREF(local_tb);
25233  Py_XINCREF(local_type);
25234  Py_XINCREF(local_value);
25235  *type = local_type;
25236  *value = local_value;
25237  *tb = local_tb;
25238 #if CYTHON_FAST_THREAD_STATE
25239  #if CYTHON_USE_EXC_INFO_STACK
25240  {
25241  _PyErr_StackItem *exc_info = tstate->exc_info;
25242  tmp_type = exc_info->exc_type;
25243  tmp_value = exc_info->exc_value;
25244  tmp_tb = exc_info->exc_traceback;
25245  exc_info->exc_type = local_type;
25246  exc_info->exc_value = local_value;
25247  exc_info->exc_traceback = local_tb;
25248  }
25249  #else
25250  tmp_type = tstate->exc_type;
25251  tmp_value = tstate->exc_value;
25252  tmp_tb = tstate->exc_traceback;
25253  tstate->exc_type = local_type;
25254  tstate->exc_value = local_value;
25255  tstate->exc_traceback = local_tb;
25256  #endif
25257  Py_XDECREF(tmp_type);
25258  Py_XDECREF(tmp_value);
25259  Py_XDECREF(tmp_tb);
25260 #else
25261  PyErr_SetExcInfo(local_type, local_value, local_tb);
25262 #endif
25263  return 0;
25264 bad:
25265  *type = 0;
25266  *value = 0;
25267  *tb = 0;
25268  Py_XDECREF(local_type);
25269  Py_XDECREF(local_value);
25270  Py_XDECREF(local_tb);
25271  return -1;
25272 }
25273 
25274 /* BytesEquals */
25275 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
25276 #if CYTHON_COMPILING_IN_PYPY
25277  return PyObject_RichCompareBool(s1, s2, equals);
25278 #else
25279  if (s1 == s2) {
25280  return (equals == Py_EQ);
25281  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
25282  const char *ps1, *ps2;
25283  Py_ssize_t length = PyBytes_GET_SIZE(s1);
25284  if (length != PyBytes_GET_SIZE(s2))
25285  return (equals == Py_NE);
25286  ps1 = PyBytes_AS_STRING(s1);
25287  ps2 = PyBytes_AS_STRING(s2);
25288  if (ps1[0] != ps2[0]) {
25289  return (equals == Py_NE);
25290  } else if (length == 1) {
25291  return (equals == Py_EQ);
25292  } else {
25293  int result;
25294 #if CYTHON_USE_UNICODE_INTERNALS
25295  Py_hash_t hash1, hash2;
25296  hash1 = ((PyBytesObject*)s1)->ob_shash;
25297  hash2 = ((PyBytesObject*)s2)->ob_shash;
25298  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25299  return (equals == Py_NE);
25300  }
25301 #endif
25302  result = memcmp(ps1, ps2, (size_t)length);
25303  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25304  }
25305  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
25306  return (equals == Py_NE);
25307  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
25308  return (equals == Py_NE);
25309  } else {
25310  int result;
25311  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25312  if (!py_result)
25313  return -1;
25314  result = __Pyx_PyObject_IsTrue(py_result);
25315  Py_DECREF(py_result);
25316  return result;
25317  }
25318 #endif
25319 }
25320 
25321 /* UnicodeEquals */
25322 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
25323 #if CYTHON_COMPILING_IN_PYPY
25324  return PyObject_RichCompareBool(s1, s2, equals);
25325 #else
25326 #if PY_MAJOR_VERSION < 3
25327  PyObject* owned_ref = NULL;
25328 #endif
25329  int s1_is_unicode, s2_is_unicode;
25330  if (s1 == s2) {
25331  goto return_eq;
25332  }
25333  s1_is_unicode = PyUnicode_CheckExact(s1);
25334  s2_is_unicode = PyUnicode_CheckExact(s2);
25335 #if PY_MAJOR_VERSION < 3
25336  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25337  owned_ref = PyUnicode_FromObject(s2);
25338  if (unlikely(!owned_ref))
25339  return -1;
25340  s2 = owned_ref;
25341  s2_is_unicode = 1;
25342  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25343  owned_ref = PyUnicode_FromObject(s1);
25344  if (unlikely(!owned_ref))
25345  return -1;
25346  s1 = owned_ref;
25347  s1_is_unicode = 1;
25348  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25349  return __Pyx_PyBytes_Equals(s1, s2, equals);
25350  }
25351 #endif
25352  if (s1_is_unicode & s2_is_unicode) {
25353  Py_ssize_t length;
25354  int kind;
25355  void *data1, *data2;
25356  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25357  return -1;
25358  length = __Pyx_PyUnicode_GET_LENGTH(s1);
25359  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25360  goto return_ne;
25361  }
25362 #if CYTHON_USE_UNICODE_INTERNALS
25363  {
25364  Py_hash_t hash1, hash2;
25365  #if CYTHON_PEP393_ENABLED
25366  hash1 = ((PyASCIIObject*)s1)->hash;
25367  hash2 = ((PyASCIIObject*)s2)->hash;
25368  #else
25369  hash1 = ((PyUnicodeObject*)s1)->hash;
25370  hash2 = ((PyUnicodeObject*)s2)->hash;
25371  #endif
25372  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25373  goto return_ne;
25374  }
25375  }
25376 #endif
25377  kind = __Pyx_PyUnicode_KIND(s1);
25378  if (kind != __Pyx_PyUnicode_KIND(s2)) {
25379  goto return_ne;
25380  }
25381  data1 = __Pyx_PyUnicode_DATA(s1);
25382  data2 = __Pyx_PyUnicode_DATA(s2);
25383  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25384  goto return_ne;
25385  } else if (length == 1) {
25386  goto return_eq;
25387  } else {
25388  int result = memcmp(data1, data2, (size_t)(length * kind));
25389  #if PY_MAJOR_VERSION < 3
25390  Py_XDECREF(owned_ref);
25391  #endif
25392  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25393  }
25394  } else if ((s1 == Py_None) & s2_is_unicode) {
25395  goto return_ne;
25396  } else if ((s2 == Py_None) & s1_is_unicode) {
25397  goto return_ne;
25398  } else {
25399  int result;
25400  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25401  #if PY_MAJOR_VERSION < 3
25402  Py_XDECREF(owned_ref);
25403  #endif
25404  if (!py_result)
25405  return -1;
25406  result = __Pyx_PyObject_IsTrue(py_result);
25407  Py_DECREF(py_result);
25408  return result;
25409  }
25410 return_eq:
25411  #if PY_MAJOR_VERSION < 3
25412  Py_XDECREF(owned_ref);
25413  #endif
25414  return (equals == Py_EQ);
25415 return_ne:
25416  #if PY_MAJOR_VERSION < 3
25417  Py_XDECREF(owned_ref);
25418  #endif
25419  return (equals == Py_NE);
25420 #endif
25421 }
25422 
25423 /* None */
25424 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25425  Py_ssize_t q = a / b;
25426  Py_ssize_t r = a - q*b;
25427  q -= ((r != 0) & ((r ^ b) < 0));
25428  return q;
25429 }
25430 
25431 /* GetAttr */
25432 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25433 #if CYTHON_USE_TYPE_SLOTS
25434 #if PY_MAJOR_VERSION >= 3
25435  if (likely(PyUnicode_Check(n)))
25436 #else
25437  if (likely(PyString_Check(n)))
25438 #endif
25439  return __Pyx_PyObject_GetAttrStr(o, n);
25440 #endif
25441  return PyObject_GetAttr(o, n);
25442 }
25443 
25444 /* GetItemInt */
25445 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25446  PyObject *r;
25447  if (!j) return NULL;
25448  r = PyObject_GetItem(o, j);
25449  Py_DECREF(j);
25450  return r;
25451 }
25452 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25453  CYTHON_NCP_UNUSED int wraparound,
25454  CYTHON_NCP_UNUSED int boundscheck) {
25455 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25456  Py_ssize_t wrapped_i = i;
25457  if (wraparound & unlikely(i < 0)) {
25458  wrapped_i += PyList_GET_SIZE(o);
25459  }
25460  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
25461  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
25462  Py_INCREF(r);
25463  return r;
25464  }
25465  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25466 #else
25467  return PySequence_GetItem(o, i);
25468 #endif
25469 }
25470 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25471  CYTHON_NCP_UNUSED int wraparound,
25472  CYTHON_NCP_UNUSED int boundscheck) {
25473 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25474  Py_ssize_t wrapped_i = i;
25475  if (wraparound & unlikely(i < 0)) {
25476  wrapped_i += PyTuple_GET_SIZE(o);
25477  }
25478  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
25479  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
25480  Py_INCREF(r);
25481  return r;
25482  }
25483  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25484 #else
25485  return PySequence_GetItem(o, i);
25486 #endif
25487 }
25488 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
25489  CYTHON_NCP_UNUSED int wraparound,
25490  CYTHON_NCP_UNUSED int boundscheck) {
25491 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
25492  if (is_list || PyList_CheckExact(o)) {
25493  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25494  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
25495  PyObject *r = PyList_GET_ITEM(o, n);
25496  Py_INCREF(r);
25497  return r;
25498  }
25499  }
25500  else if (PyTuple_CheckExact(o)) {
25501  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25502  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
25503  PyObject *r = PyTuple_GET_ITEM(o, n);
25504  Py_INCREF(r);
25505  return r;
25506  }
25507  } else {
25508  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
25509  if (likely(m && m->sq_item)) {
25510  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
25511  Py_ssize_t l = m->sq_length(o);
25512  if (likely(l >= 0)) {
25513  i += l;
25514  } else {
25515  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25516  return NULL;
25517  PyErr_Clear();
25518  }
25519  }
25520  return m->sq_item(o, i);
25521  }
25522  }
25523 #else
25524  if (is_list || PySequence_Check(o)) {
25525  return PySequence_GetItem(o, i);
25526  }
25527 #endif
25528  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25529 }
25530 
25531 /* ObjectGetItem */
25532 #if CYTHON_USE_TYPE_SLOTS
25533 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25534  PyObject *runerr;
25535  Py_ssize_t key_value;
25536  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25537  if (unlikely(!(m && m->sq_item))) {
25538  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25539  return NULL;
25540  }
25541  key_value = __Pyx_PyIndex_AsSsize_t(index);
25542  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25543  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25544  }
25545  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25546  PyErr_Clear();
25547  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25548  }
25549  return NULL;
25550 }
25551 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25552  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25553  if (likely(m && m->mp_subscript)) {
25554  return m->mp_subscript(obj, key);
25555  }
25556  return __Pyx_PyObject_GetIndex(obj, key);
25557 }
25558 #endif
25559 
25560 /* decode_c_string */
25561 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25562  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25563  const char* encoding, const char* errors,
25564  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
25565  Py_ssize_t length;
25566  if (unlikely((start < 0) | (stop < 0))) {
25567  size_t slen = strlen(cstring);
25568  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
25569  PyErr_SetString(PyExc_OverflowError,
25570  "c-string too long to convert to Python");
25571  return NULL;
25572  }
25573  length = (Py_ssize_t) slen;
25574  if (start < 0) {
25575  start += length;
25576  if (start < 0)
25577  start = 0;
25578  }
25579  if (stop < 0)
25580  stop += length;
25581  }
25582  length = stop - start;
25583  if (unlikely(length <= 0))
25584  return PyUnicode_FromUnicode(NULL, 0);
25585  cstring += start;
25586  if (decode_func) {
25587  return decode_func(cstring, length, errors);
25588  } else {
25589  return PyUnicode_Decode(cstring, length, encoding, errors);
25590  }
25591 }
25592 
25593 /* GetAttr3 */
25594 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25595  __Pyx_PyThreadState_declare
25596  __Pyx_PyThreadState_assign
25597  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25598  return NULL;
25599  __Pyx_PyErr_Clear();
25600  Py_INCREF(d);
25601  return d;
25602 }
25603 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25604  PyObject *r = __Pyx_GetAttr(o, n);
25605  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25606 }
25607 
25608 /* SwapException */
25609 #if CYTHON_FAST_THREAD_STATE
25610 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25611  PyObject *tmp_type, *tmp_value, *tmp_tb;
25612  #if CYTHON_USE_EXC_INFO_STACK
25613  _PyErr_StackItem *exc_info = tstate->exc_info;
25614  tmp_type = exc_info->exc_type;
25615  tmp_value = exc_info->exc_value;
25616  tmp_tb = exc_info->exc_traceback;
25617  exc_info->exc_type = *type;
25618  exc_info->exc_value = *value;
25619  exc_info->exc_traceback = *tb;
25620  #else
25621  tmp_type = tstate->exc_type;
25622  tmp_value = tstate->exc_value;
25623  tmp_tb = tstate->exc_traceback;
25624  tstate->exc_type = *type;
25625  tstate->exc_value = *value;
25626  tstate->exc_traceback = *tb;
25627  #endif
25628  *type = tmp_type;
25629  *value = tmp_value;
25630  *tb = tmp_tb;
25631 }
25632 #else
25633 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25634  PyObject *tmp_type, *tmp_value, *tmp_tb;
25635  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25636  PyErr_SetExcInfo(*type, *value, *tb);
25637  *type = tmp_type;
25638  *value = tmp_value;
25639  *tb = tmp_tb;
25640 }
25641 #endif
25642 
25643 /* Import */
25644 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25645  PyObject *empty_list = 0;
25646  PyObject *module = 0;
25647  PyObject *global_dict = 0;
25648  PyObject *empty_dict = 0;
25649  PyObject *list;
25650  #if PY_MAJOR_VERSION < 3
25651  PyObject *py_import;
25652  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25653  if (!py_import)
25654  goto bad;
25655  #endif
25656  if (from_list)
25657  list = from_list;
25658  else {
25659  empty_list = PyList_New(0);
25660  if (!empty_list)
25661  goto bad;
25662  list = empty_list;
25663  }
25664  global_dict = PyModule_GetDict(__pyx_m);
25665  if (!global_dict)
25666  goto bad;
25667  empty_dict = PyDict_New();
25668  if (!empty_dict)
25669  goto bad;
25670  {
25671  #if PY_MAJOR_VERSION >= 3
25672  if (level == -1) {
25673  if (strchr(__Pyx_MODULE_NAME, '.')) {
25674  module = PyImport_ImportModuleLevelObject(
25675  name, global_dict, empty_dict, list, 1);
25676  if (!module) {
25677  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25678  goto bad;
25679  PyErr_Clear();
25680  }
25681  }
25682  level = 0;
25683  }
25684  #endif
25685  if (!module) {
25686  #if PY_MAJOR_VERSION < 3
25687  PyObject *py_level = PyInt_FromLong(level);
25688  if (!py_level)
25689  goto bad;
25690  module = PyObject_CallFunctionObjArgs(py_import,
25691  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25692  Py_DECREF(py_level);
25693  #else
25694  module = PyImport_ImportModuleLevelObject(
25695  name, global_dict, empty_dict, list, level);
25696  #endif
25697  }
25698  }
25699 bad:
25700  #if PY_MAJOR_VERSION < 3
25701  Py_XDECREF(py_import);
25702  #endif
25703  Py_XDECREF(empty_list);
25704  Py_XDECREF(empty_dict);
25705  return module;
25706 }
25707 
25708 /* FastTypeChecks */
25709 #if CYTHON_COMPILING_IN_CPYTHON
25710 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25711  while (a) {
25712  a = a->tp_base;
25713  if (a == b)
25714  return 1;
25715  }
25716  return b == &PyBaseObject_Type;
25717 }
25718 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25719  PyObject *mro;
25720  if (a == b) return 1;
25721  mro = a->tp_mro;
25722  if (likely(mro)) {
25723  Py_ssize_t i, n;
25724  n = PyTuple_GET_SIZE(mro);
25725  for (i = 0; i < n; i++) {
25726  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25727  return 1;
25728  }
25729  return 0;
25730  }
25731  return __Pyx_InBases(a, b);
25732 }
25733 #if PY_MAJOR_VERSION == 2
25734 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25735  PyObject *exception, *value, *tb;
25736  int res;
25737  __Pyx_PyThreadState_declare
25738  __Pyx_PyThreadState_assign
25739  __Pyx_ErrFetch(&exception, &value, &tb);
25740  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25741  if (unlikely(res == -1)) {
25742  PyErr_WriteUnraisable(err);
25743  res = 0;
25744  }
25745  if (!res) {
25746  res = PyObject_IsSubclass(err, exc_type2);
25747  if (unlikely(res == -1)) {
25748  PyErr_WriteUnraisable(err);
25749  res = 0;
25750  }
25751  }
25752  __Pyx_ErrRestore(exception, value, tb);
25753  return res;
25754 }
25755 #else
25756 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25757  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25758  if (!res) {
25759  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25760  }
25761  return res;
25762 }
25763 #endif
25764 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25765  Py_ssize_t i, n;
25766  assert(PyExceptionClass_Check(exc_type));
25767  n = PyTuple_GET_SIZE(tuple);
25768 #if PY_MAJOR_VERSION >= 3
25769  for (i=0; i<n; i++) {
25770  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25771  }
25772 #endif
25773  for (i=0; i<n; i++) {
25774  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25775  #if PY_MAJOR_VERSION < 3
25776  if (likely(exc_type == t)) return 1;
25777  #endif
25778  if (likely(PyExceptionClass_Check(t))) {
25779  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25780  } else {
25781  }
25782  }
25783  return 0;
25784 }
25785 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25786  if (likely(err == exc_type)) return 1;
25787  if (likely(PyExceptionClass_Check(err))) {
25788  if (likely(PyExceptionClass_Check(exc_type))) {
25789  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25790  } else if (likely(PyTuple_Check(exc_type))) {
25791  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25792  } else {
25793  }
25794  }
25795  return PyErr_GivenExceptionMatches(err, exc_type);
25796 }
25797 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25798  assert(PyExceptionClass_Check(exc_type1));
25799  assert(PyExceptionClass_Check(exc_type2));
25800  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25801  if (likely(PyExceptionClass_Check(err))) {
25802  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25803  }
25804  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25805 }
25806 #endif
25807 
25808 /* None */
25809 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25810  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25811 }
25812 
25813 /* None */
25814 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
25815  long q = a / b;
25816  long r = a - q*b;
25817  q -= ((r != 0) & ((r ^ b) < 0));
25818  return q;
25819 }
25820 
25821 /* ImportFrom */
25822 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25823  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25824  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25825  PyErr_Format(PyExc_ImportError,
25826  #if PY_MAJOR_VERSION < 3
25827  "cannot import name %.230s", PyString_AS_STRING(name));
25828  #else
25829  "cannot import name %S", name);
25830  #endif
25831  }
25832  return value;
25833 }
25834 
25835 /* HasAttr */
25836 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25837  PyObject *r;
25838  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25839  PyErr_SetString(PyExc_TypeError,
25840  "hasattr(): attribute name must be string");
25841  return -1;
25842  }
25843  r = __Pyx_GetAttr(o, n);
25844  if (unlikely(!r)) {
25845  PyErr_Clear();
25846  return 0;
25847  } else {
25848  Py_DECREF(r);
25849  return 1;
25850  }
25851 }
25852 
25853 /* StringJoin */
25854 #if !CYTHON_COMPILING_IN_CPYTHON
25855 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
25856  return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
25857 }
25858 #endif
25859 
25860 /* PyObject_GenericGetAttrNoDict */
25861 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25862 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25863  PyErr_Format(PyExc_AttributeError,
25864 #if PY_MAJOR_VERSION >= 3
25865  "'%.50s' object has no attribute '%U'",
25866  tp->tp_name, attr_name);
25867 #else
25868  "'%.50s' object has no attribute '%.400s'",
25869  tp->tp_name, PyString_AS_STRING(attr_name));
25870 #endif
25871  return NULL;
25872 }
25873 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25874  PyObject *descr;
25875  PyTypeObject *tp = Py_TYPE(obj);
25876  if (unlikely(!PyString_Check(attr_name))) {
25877  return PyObject_GenericGetAttr(obj, attr_name);
25878  }
25879  assert(!tp->tp_dictoffset);
25880  descr = _PyType_Lookup(tp, attr_name);
25881  if (unlikely(!descr)) {
25882  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25883  }
25884  Py_INCREF(descr);
25885  #if PY_MAJOR_VERSION < 3
25886  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25887  #endif
25888  {
25889  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25890  if (unlikely(f)) {
25891  PyObject *res = f(descr, obj, (PyObject *)tp);
25892  Py_DECREF(descr);
25893  return res;
25894  }
25895  }
25896  return descr;
25897 }
25898 #endif
25899 
25900 /* PyObject_GenericGetAttr */
25901 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25902 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25903  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25904  return PyObject_GenericGetAttr(obj, attr_name);
25905  }
25906  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25907 }
25908 #endif
25909 
25910 /* SetVTable */
25911 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
25912 #if PY_VERSION_HEX >= 0x02070000
25913  PyObject *ob = PyCapsule_New(vtable, 0, 0);
25914 #else
25915  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25916 #endif
25917  if (!ob)
25918  goto bad;
25919  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25920  goto bad;
25921  Py_DECREF(ob);
25922  return 0;
25923 bad:
25924  Py_XDECREF(ob);
25925  return -1;
25926 }
25927 
25928 /* SetupReduce */
25929 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25930  int ret;
25931  PyObject *name_attr;
25932  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25933  if (likely(name_attr)) {
25934  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25935  } else {
25936  ret = -1;
25937  }
25938  if (unlikely(ret < 0)) {
25939  PyErr_Clear();
25940  ret = 0;
25941  }
25942  Py_XDECREF(name_attr);
25943  return ret;
25944 }
25945 static int __Pyx_setup_reduce(PyObject* type_obj) {
25946  int ret = 0;
25947  PyObject *object_reduce = NULL;
25948  PyObject *object_reduce_ex = NULL;
25949  PyObject *reduce = NULL;
25950  PyObject *reduce_ex = NULL;
25951  PyObject *reduce_cython = NULL;
25952  PyObject *setstate = NULL;
25953  PyObject *setstate_cython = NULL;
25954 #if CYTHON_USE_PYTYPE_LOOKUP
25955  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25956 #else
25957  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25958 #endif
25959 #if CYTHON_USE_PYTYPE_LOOKUP
25960  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25961 #else
25962  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25963 #endif
25964  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
25965  if (reduce_ex == object_reduce_ex) {
25966 #if CYTHON_USE_PYTYPE_LOOKUP
25967  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25968 #else
25969  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25970 #endif
25971  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
25972  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25973  reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto __PYX_BAD;
25974  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25975  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25976  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25977  if (!setstate) PyErr_Clear();
25978  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25979  setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto __PYX_BAD;
25980  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25981  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25982  }
25983  PyType_Modified((PyTypeObject*)type_obj);
25984  }
25985  }
25986  goto __PYX_GOOD;
25987 __PYX_BAD:
25988  if (!PyErr_Occurred())
25989  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25990  ret = -1;
25991 __PYX_GOOD:
25992 #if !CYTHON_USE_PYTYPE_LOOKUP
25993  Py_XDECREF(object_reduce);
25994  Py_XDECREF(object_reduce_ex);
25995 #endif
25996  Py_XDECREF(reduce);
25997  Py_XDECREF(reduce_ex);
25998  Py_XDECREF(reduce_cython);
25999  Py_XDECREF(setstate);
26000  Py_XDECREF(setstate_cython);
26001  return ret;
26002 }
26003 
26004 /* TypeImport */
26005 #ifndef __PYX_HAVE_RT_ImportType
26006 #define __PYX_HAVE_RT_ImportType
26007 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
26008  size_t size, enum __Pyx_ImportType_CheckSize check_size)
26009 {
26010  PyObject *result = 0;
26011  char warning[200];
26012  Py_ssize_t basicsize;
26013 #ifdef Py_LIMITED_API
26014  PyObject *py_basicsize;
26015 #endif
26016  result = PyObject_GetAttrString(module, class_name);
26017  if (!result)
26018  goto bad;
26019  if (!PyType_Check(result)) {
26020  PyErr_Format(PyExc_TypeError,
26021  "%.200s.%.200s is not a type object",
26022  module_name, class_name);
26023  goto bad;
26024  }
26025 #ifndef Py_LIMITED_API
26026  basicsize = ((PyTypeObject *)result)->tp_basicsize;
26027 #else
26028  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
26029  if (!py_basicsize)
26030  goto bad;
26031  basicsize = PyLong_AsSsize_t(py_basicsize);
26032  Py_DECREF(py_basicsize);
26033  py_basicsize = 0;
26034  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
26035  goto bad;
26036 #endif
26037  if ((size_t)basicsize < size) {
26038  PyErr_Format(PyExc_ValueError,
26039  "%.200s.%.200s size changed, may indicate binary incompatibility. "
26040  "Expected %zd from C header, got %zd from PyObject",
26041  module_name, class_name, size, basicsize);
26042  goto bad;
26043  }
26044  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
26045  PyErr_Format(PyExc_ValueError,
26046  "%.200s.%.200s size changed, may indicate binary incompatibility. "
26047  "Expected %zd from C header, got %zd from PyObject",
26048  module_name, class_name, size, basicsize);
26049  goto bad;
26050  }
26051  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
26052  PyOS_snprintf(warning, sizeof(warning),
26053  "%s.%s size changed, may indicate binary incompatibility. "
26054  "Expected %zd from C header, got %zd from PyObject",
26055  module_name, class_name, size, basicsize);
26056  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
26057  }
26058  return (PyTypeObject *)result;
26059 bad:
26060  Py_XDECREF(result);
26061  return NULL;
26062 }
26063 #endif
26064 
26065 /* CLineInTraceback */
26066 #ifndef CYTHON_CLINE_IN_TRACEBACK
26067 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
26068  PyObject *use_cline;
26069  PyObject *ptype, *pvalue, *ptraceback;
26070 #if CYTHON_COMPILING_IN_CPYTHON
26071  PyObject **cython_runtime_dict;
26072 #endif
26073  if (unlikely(!__pyx_cython_runtime)) {
26074  return c_line;
26075  }
26076  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26077 #if CYTHON_COMPILING_IN_CPYTHON
26078  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26079  if (likely(cython_runtime_dict)) {
26080  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26081  use_cline, *cython_runtime_dict,
26082  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26083  } else
26084 #endif
26085  {
26086  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26087  if (use_cline_obj) {
26088  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26089  Py_DECREF(use_cline_obj);
26090  } else {
26091  PyErr_Clear();
26092  use_cline = NULL;
26093  }
26094  }
26095  if (!use_cline) {
26096  c_line = 0;
26097  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26098  }
26099  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26100  c_line = 0;
26101  }
26102  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26103  return c_line;
26104 }
26105 #endif
26106 
26107 /* CodeObjectCache */
26108 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
26109  int start = 0, mid = 0, end = count - 1;
26110  if (end >= 0 && code_line > entries[end].code_line) {
26111  return count;
26112  }
26113  while (start < end) {
26114  mid = start + (end - start) / 2;
26115  if (code_line < entries[mid].code_line) {
26116  end = mid;
26117  } else if (code_line > entries[mid].code_line) {
26118  start = mid + 1;
26119  } else {
26120  return mid;
26121  }
26122  }
26123  if (code_line <= entries[mid].code_line) {
26124  return mid;
26125  } else {
26126  return mid + 1;
26127  }
26128 }
26129 static PyCodeObject *__pyx_find_code_object(int code_line) {
26130  PyCodeObject* code_object;
26131  int pos;
26132  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26133  return NULL;
26134  }
26135  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26136  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26137  return NULL;
26138  }
26139  code_object = __pyx_code_cache.entries[pos].code_object;
26140  Py_INCREF(code_object);
26141  return code_object;
26142 }
26143 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
26144  int pos, i;
26145  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26146  if (unlikely(!code_line)) {
26147  return;
26148  }
26149  if (unlikely(!entries)) {
26150  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26151  if (likely(entries)) {
26152  __pyx_code_cache.entries = entries;
26153  __pyx_code_cache.max_count = 64;
26154  __pyx_code_cache.count = 1;
26155  entries[0].code_line = code_line;
26156  entries[0].code_object = code_object;
26157  Py_INCREF(code_object);
26158  }
26159  return;
26160  }
26161  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26162  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26163  PyCodeObject* tmp = entries[pos].code_object;
26164  entries[pos].code_object = code_object;
26165  Py_DECREF(tmp);
26166  return;
26167  }
26168  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26169  int new_max = __pyx_code_cache.max_count + 64;
26170  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26171  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
26172  if (unlikely(!entries)) {
26173  return;
26174  }
26175  __pyx_code_cache.entries = entries;
26176  __pyx_code_cache.max_count = new_max;
26177  }
26178  for (i=__pyx_code_cache.count; i>pos; i--) {
26179  entries[i] = entries[i-1];
26180  }
26181  entries[pos].code_line = code_line;
26182  entries[pos].code_object = code_object;
26183  __pyx_code_cache.count++;
26184  Py_INCREF(code_object);
26185 }
26186 
26187 /* AddTraceback */
26188 #include "compile.h"
26189 #include "frameobject.h"
26190 #include "traceback.h"
26191 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26192  const char *funcname, int c_line,
26193  int py_line, const char *filename) {
26194  PyCodeObject *py_code = 0;
26195  PyObject *py_srcfile = 0;
26196  PyObject *py_funcname = 0;
26197  #if PY_MAJOR_VERSION < 3
26198  py_srcfile = PyString_FromString(filename);
26199  #else
26200  py_srcfile = PyUnicode_FromString(filename);
26201  #endif
26202  if (!py_srcfile) goto bad;
26203  if (c_line) {
26204  #if PY_MAJOR_VERSION < 3
26205  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26206  #else
26207  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26208  #endif
26209  }
26210  else {
26211  #if PY_MAJOR_VERSION < 3
26212  py_funcname = PyString_FromString(funcname);
26213  #else
26214  py_funcname = PyUnicode_FromString(funcname);
26215  #endif
26216  }
26217  if (!py_funcname) goto bad;
26218  py_code = __Pyx_PyCode_New(
26219  0,
26220  0,
26221  0,
26222  0,
26223  0,
26224  __pyx_empty_bytes, /*PyObject *code,*/
26225  __pyx_empty_tuple, /*PyObject *consts,*/
26226  __pyx_empty_tuple, /*PyObject *names,*/
26227  __pyx_empty_tuple, /*PyObject *varnames,*/
26228  __pyx_empty_tuple, /*PyObject *freevars,*/
26229  __pyx_empty_tuple, /*PyObject *cellvars,*/
26230  py_srcfile, /*PyObject *filename,*/
26231  py_funcname, /*PyObject *name,*/
26232  py_line,
26233  __pyx_empty_bytes /*PyObject *lnotab*/
26234  );
26235  Py_DECREF(py_srcfile);
26236  Py_DECREF(py_funcname);
26237  return py_code;
26238 bad:
26239  Py_XDECREF(py_srcfile);
26240  Py_XDECREF(py_funcname);
26241  return NULL;
26242 }
26243 static void __Pyx_AddTraceback(const char *funcname, int c_line,
26244  int py_line, const char *filename) {
26245  PyCodeObject *py_code = 0;
26246  PyFrameObject *py_frame = 0;
26247  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26248  if (c_line) {
26249  c_line = __Pyx_CLineForTraceback(tstate, c_line);
26250  }
26251  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26252  if (!py_code) {
26253  py_code = __Pyx_CreateCodeObjectForTraceback(
26254  funcname, c_line, py_line, filename);
26255  if (!py_code) goto bad;
26256  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26257  }
26258  py_frame = PyFrame_New(
26259  tstate, /*PyThreadState *tstate,*/
26260  py_code, /*PyCodeObject *code,*/
26261  __pyx_d, /*PyObject *globals,*/
26262  0 /*PyObject *locals*/
26263  );
26264  if (!py_frame) goto bad;
26265  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26266  PyTraceBack_Here(py_frame);
26267 bad:
26268  Py_XDECREF(py_code);
26269  Py_XDECREF(py_frame);
26270 }
26271 
26272 /* CIntFromPyVerify */
26273 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
26274  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
26275 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
26276  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
26277 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
26278  {\
26279  func_type value = func_value;\
26280  if (sizeof(target_type) < sizeof(func_type)) {\
26281  if (unlikely(value != (func_type) (target_type) value)) {\
26282  func_type zero = 0;\
26283  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
26284  return (target_type) -1;\
26285  if (is_unsigned && unlikely(value < zero))\
26286  goto raise_neg_overflow;\
26287  else\
26288  goto raise_overflow;\
26289  }\
26290  }\
26291  return (target_type) value;\
26292  }
26293 
26294 /* CIntToPy */
26295 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
26296  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
26297  const int is_unsigned = neg_one > const_zero;
26298  if (is_unsigned) {
26299  if (sizeof(int) < sizeof(long)) {
26300  return PyInt_FromLong((long) value);
26301  } else if (sizeof(int) <= sizeof(unsigned long)) {
26302  return PyLong_FromUnsignedLong((unsigned long) value);
26303 #ifdef HAVE_LONG_LONG
26304  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
26305  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
26306 #endif
26307  }
26308  } else {
26309  if (sizeof(int) <= sizeof(long)) {
26310  return PyInt_FromLong((long) value);
26311 #ifdef HAVE_LONG_LONG
26312  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
26313  return PyLong_FromLongLong((PY_LONG_LONG) value);
26314 #endif
26315  }
26316  }
26317  {
26318  int one = 1; int little = (int)*(unsigned char *)&one;
26319  unsigned char *bytes = (unsigned char *)&value;
26320  return _PyLong_FromByteArray(bytes, sizeof(int),
26321  little, !is_unsigned);
26322  }
26323 }
26324 
26325 /* MemviewDtypeToObject */
26326 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
26327  return (PyObject *) __Pyx_PyInt_From_int(*(int *) itemp);
26328 }
26329 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
26330  int value = __Pyx_PyInt_As_int(obj);
26331  if ((value == (int)-1) && PyErr_Occurred())
26332  return 0;
26333  *(int *) itemp = value;
26334  return 1;
26335 }
26336 
26337 /* Declarations */
26338 #if CYTHON_CCOMPLEX
26339  #ifdef __cplusplus
26340  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26341  return ::std::complex< float >(x, y);
26342  }
26343  #else
26344  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26345  return x + y*(__pyx_t_float_complex)_Complex_I;
26346  }
26347  #endif
26348 #else
26349  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26350  __pyx_t_float_complex z;
26351  z.real = x;
26352  z.imag = y;
26353  return z;
26354  }
26355 #endif
26356 
26357 /* Arithmetic */
26358 #if CYTHON_CCOMPLEX
26359 #else
26360  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26361  return (a.real == b.real) && (a.imag == b.imag);
26362  }
26363  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26364  __pyx_t_float_complex z;
26365  z.real = a.real + b.real;
26366  z.imag = a.imag + b.imag;
26367  return z;
26368  }
26369  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26370  __pyx_t_float_complex z;
26371  z.real = a.real - b.real;
26372  z.imag = a.imag - b.imag;
26373  return z;
26374  }
26375  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26376  __pyx_t_float_complex z;
26377  z.real = a.real * b.real - a.imag * b.imag;
26378  z.imag = a.real * b.imag + a.imag * b.real;
26379  return z;
26380  }
26381  #if 1
26382  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26383  if (b.imag == 0) {
26384  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26385  } else if (fabsf(b.real) >= fabsf(b.imag)) {
26386  if (b.real == 0 && b.imag == 0) {
26387  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
26388  } else {
26389  float r = b.imag / b.real;
26390  float s = (float)(1.0) / (b.real + b.imag * r);
26391  return __pyx_t_float_complex_from_parts(
26392  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26393  }
26394  } else {
26395  float r = b.real / b.imag;
26396  float s = (float)(1.0) / (b.imag + b.real * r);
26397  return __pyx_t_float_complex_from_parts(
26398  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26399  }
26400  }
26401  #else
26402  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26403  if (b.imag == 0) {
26404  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26405  } else {
26406  float denom = b.real * b.real + b.imag * b.imag;
26407  return __pyx_t_float_complex_from_parts(
26408  (a.real * b.real + a.imag * b.imag) / denom,
26409  (a.imag * b.real - a.real * b.imag) / denom);
26410  }
26411  }
26412  #endif
26413  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
26414  __pyx_t_float_complex z;
26415  z.real = -a.real;
26416  z.imag = -a.imag;
26417  return z;
26418  }
26419  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
26420  return (a.real == 0) && (a.imag == 0);
26421  }
26422  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
26423  __pyx_t_float_complex z;
26424  z.real = a.real;
26425  z.imag = -a.imag;
26426  return z;
26427  }
26428  #if 1
26429  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
26430  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26431  return sqrtf(z.real*z.real + z.imag*z.imag);
26432  #else
26433  return hypotf(z.real, z.imag);
26434  #endif
26435  }
26436  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26437  __pyx_t_float_complex z;
26438  float r, lnr, theta, z_r, z_theta;
26439  if (b.imag == 0 && b.real == (int)b.real) {
26440  if (b.real < 0) {
26441  float denom = a.real * a.real + a.imag * a.imag;
26442  a.real = a.real / denom;
26443  a.imag = -a.imag / denom;
26444  b.real = -b.real;
26445  }
26446  switch ((int)b.real) {
26447  case 0:
26448  z.real = 1;
26449  z.imag = 0;
26450  return z;
26451  case 1:
26452  return a;
26453  case 2:
26454  return __Pyx_c_prod_float(a, a);
26455  case 3:
26456  z = __Pyx_c_prod_float(a, a);
26457  return __Pyx_c_prod_float(z, a);
26458  case 4:
26459  z = __Pyx_c_prod_float(a, a);
26460  return __Pyx_c_prod_float(z, z);
26461  }
26462  }
26463  if (a.imag == 0) {
26464  if (a.real == 0) {
26465  return a;
26466  } else if (b.imag == 0) {
26467  z.real = powf(a.real, b.real);
26468  z.imag = 0;
26469  return z;
26470  } else if (a.real > 0) {
26471  r = a.real;
26472  theta = 0;
26473  } else {
26474  r = -a.real;
26475  theta = atan2f(0.0, -1.0);
26476  }
26477  } else {
26478  r = __Pyx_c_abs_float(a);
26479  theta = atan2f(a.imag, a.real);
26480  }
26481  lnr = logf(r);
26482  z_r = expf(lnr * b.real - theta * b.imag);
26483  z_theta = theta * b.real + lnr * b.imag;
26484  z.real = z_r * cosf(z_theta);
26485  z.imag = z_r * sinf(z_theta);
26486  return z;
26487  }
26488  #endif
26489 #endif
26490 
26491 /* Declarations */
26492 #if CYTHON_CCOMPLEX
26493  #ifdef __cplusplus
26494  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26495  return ::std::complex< double >(x, y);
26496  }
26497  #else
26498  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26499  return x + y*(__pyx_t_double_complex)_Complex_I;
26500  }
26501  #endif
26502 #else
26503  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26504  __pyx_t_double_complex z;
26505  z.real = x;
26506  z.imag = y;
26507  return z;
26508  }
26509 #endif
26510 
26511 /* Arithmetic */
26512 #if CYTHON_CCOMPLEX
26513 #else
26514  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26515  return (a.real == b.real) && (a.imag == b.imag);
26516  }
26517  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26518  __pyx_t_double_complex z;
26519  z.real = a.real + b.real;
26520  z.imag = a.imag + b.imag;
26521  return z;
26522  }
26523  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26524  __pyx_t_double_complex z;
26525  z.real = a.real - b.real;
26526  z.imag = a.imag - b.imag;
26527  return z;
26528  }
26529  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26530  __pyx_t_double_complex z;
26531  z.real = a.real * b.real - a.imag * b.imag;
26532  z.imag = a.real * b.imag + a.imag * b.real;
26533  return z;
26534  }
26535  #if 1
26536  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26537  if (b.imag == 0) {
26538  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26539  } else if (fabs(b.real) >= fabs(b.imag)) {
26540  if (b.real == 0 && b.imag == 0) {
26541  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
26542  } else {
26543  double r = b.imag / b.real;
26544  double s = (double)(1.0) / (b.real + b.imag * r);
26545  return __pyx_t_double_complex_from_parts(
26546  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26547  }
26548  } else {
26549  double r = b.real / b.imag;
26550  double s = (double)(1.0) / (b.imag + b.real * r);
26551  return __pyx_t_double_complex_from_parts(
26552  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26553  }
26554  }
26555  #else
26556  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26557  if (b.imag == 0) {
26558  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26559  } else {
26560  double denom = b.real * b.real + b.imag * b.imag;
26561  return __pyx_t_double_complex_from_parts(
26562  (a.real * b.real + a.imag * b.imag) / denom,
26563  (a.imag * b.real - a.real * b.imag) / denom);
26564  }
26565  }
26566  #endif
26567  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
26568  __pyx_t_double_complex z;
26569  z.real = -a.real;
26570  z.imag = -a.imag;
26571  return z;
26572  }
26573  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
26574  return (a.real == 0) && (a.imag == 0);
26575  }
26576  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
26577  __pyx_t_double_complex z;
26578  z.real = a.real;
26579  z.imag = -a.imag;
26580  return z;
26581  }
26582  #if 1
26583  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
26584  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26585  return sqrt(z.real*z.real + z.imag*z.imag);
26586  #else
26587  return hypot(z.real, z.imag);
26588  #endif
26589  }
26590  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26591  __pyx_t_double_complex z;
26592  double r, lnr, theta, z_r, z_theta;
26593  if (b.imag == 0 && b.real == (int)b.real) {
26594  if (b.real < 0) {
26595  double denom = a.real * a.real + a.imag * a.imag;
26596  a.real = a.real / denom;
26597  a.imag = -a.imag / denom;
26598  b.real = -b.real;
26599  }
26600  switch ((int)b.real) {
26601  case 0:
26602  z.real = 1;
26603  z.imag = 0;
26604  return z;
26605  case 1:
26606  return a;
26607  case 2:
26608  return __Pyx_c_prod_double(a, a);
26609  case 3:
26610  z = __Pyx_c_prod_double(a, a);
26611  return __Pyx_c_prod_double(z, a);
26612  case 4:
26613  z = __Pyx_c_prod_double(a, a);
26614  return __Pyx_c_prod_double(z, z);
26615  }
26616  }
26617  if (a.imag == 0) {
26618  if (a.real == 0) {
26619  return a;
26620  } else if (b.imag == 0) {
26621  z.real = pow(a.real, b.real);
26622  z.imag = 0;
26623  return z;
26624  } else if (a.real > 0) {
26625  r = a.real;
26626  theta = 0;
26627  } else {
26628  r = -a.real;
26629  theta = atan2(0.0, -1.0);
26630  }
26631  } else {
26632  r = __Pyx_c_abs_double(a);
26633  theta = atan2(a.imag, a.real);
26634  }
26635  lnr = log(r);
26636  z_r = exp(lnr * b.real - theta * b.imag);
26637  z_theta = theta * b.real + lnr * b.imag;
26638  z.real = z_r * cos(z_theta);
26639  z.imag = z_r * sin(z_theta);
26640  return z;
26641  }
26642  #endif
26643 #endif
26644 
26645 /* CIntToPy */
26646 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
26647  const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
26648  const int is_unsigned = neg_one > const_zero;
26649  if (is_unsigned) {
26650  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
26651  return PyInt_FromLong((long) value);
26652  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
26653  return PyLong_FromUnsignedLong((unsigned long) value);
26654 #ifdef HAVE_LONG_LONG
26655  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
26656  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
26657 #endif
26658  }
26659  } else {
26660  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
26661  return PyInt_FromLong((long) value);
26662 #ifdef HAVE_LONG_LONG
26663  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
26664  return PyLong_FromLongLong((PY_LONG_LONG) value);
26665 #endif
26666  }
26667  }
26668  {
26669  int one = 1; int little = (int)*(unsigned char *)&one;
26670  unsigned char *bytes = (unsigned char *)&value;
26671  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
26672  little, !is_unsigned);
26673  }
26674 }
26675 
26676 #if PY_MAJOR_VERSION < 3
26677 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26678  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26679  if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
26680  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26681  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26682  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26683  return -1;
26684 }
26685 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26686  PyObject *obj = view->obj;
26687  if (!obj) return;
26688  if (PyObject_CheckBuffer(obj)) {
26689  PyBuffer_Release(view);
26690  return;
26691  }
26692  if ((0)) {}
26693  else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
26694  view->obj = NULL;
26695  Py_DECREF(obj);
26696 }
26697 #endif
26698 
26699 
26700 /* MemviewSliceIsContig */
26701 static int
26702 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
26703 {
26704  int i, index, step, start;
26705  Py_ssize_t itemsize = mvs.memview->view.itemsize;
26706  if (order == 'F') {
26707  step = 1;
26708  start = 0;
26709  } else {
26710  step = -1;
26711  start = ndim - 1;
26712  }
26713  for (i = 0; i < ndim; i++) {
26714  index = start + step * i;
26715  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26716  return 0;
26717  itemsize *= mvs.shape[index];
26718  }
26719  return 1;
26720 }
26721 
26722 /* OverlappingSlices */
26723 static void
26724 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26725  void **out_start, void **out_end,
26726  int ndim, size_t itemsize)
26727 {
26728  char *start, *end;
26729  int i;
26730  start = end = slice->data;
26731  for (i = 0; i < ndim; i++) {
26732  Py_ssize_t stride = slice->strides[i];
26733  Py_ssize_t extent = slice->shape[i];
26734  if (extent == 0) {
26735  *out_start = *out_end = start;
26736  return;
26737  } else {
26738  if (stride > 0)
26739  end += stride * (extent - 1);
26740  else
26741  start += stride * (extent - 1);
26742  }
26743  }
26744  *out_start = start;
26745  *out_end = end + itemsize;
26746 }
26747 static int
26748 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26749  __Pyx_memviewslice *slice2,
26750  int ndim, size_t itemsize)
26751 {
26752  void *start1, *end1, *start2, *end2;
26753  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26754  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26755  return (start1 < end2) && (start2 < end1);
26756 }
26757 
26758 /* Capsule */
26759 static CYTHON_INLINE PyObject *
26760 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
26761 {
26762  PyObject *cobj;
26763 #if PY_VERSION_HEX >= 0x02070000
26764  cobj = PyCapsule_New(p, sig, NULL);
26765 #else
26766  cobj = PyCObject_FromVoidPtr(p, NULL);
26767 #endif
26768  return cobj;
26769 }
26770 
26771 /* CIntFromPy */
26772 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
26773  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
26774  const int is_unsigned = neg_one > const_zero;
26775 #if PY_MAJOR_VERSION < 3
26776  if (likely(PyInt_Check(x))) {
26777  if (sizeof(int) < sizeof(long)) {
26778  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
26779  } else {
26780  long val = PyInt_AS_LONG(x);
26781  if (is_unsigned && unlikely(val < 0)) {
26782  goto raise_neg_overflow;
26783  }
26784  return (int) val;
26785  }
26786  } else
26787 #endif
26788  if (likely(PyLong_Check(x))) {
26789  if (is_unsigned) {
26790 #if CYTHON_USE_PYLONG_INTERNALS
26791  const digit* digits = ((PyLongObject*)x)->ob_digit;
26792  switch (Py_SIZE(x)) {
26793  case 0: return (int) 0;
26794  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
26795  case 2:
26796  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26797  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26798  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26799  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
26800  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26801  }
26802  }
26803  break;
26804  case 3:
26805  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26806  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26807  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26808  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
26809  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26810  }
26811  }
26812  break;
26813  case 4:
26814  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26815  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26816  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26817  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
26818  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26819  }
26820  }
26821  break;
26822  }
26823 #endif
26824 #if CYTHON_COMPILING_IN_CPYTHON
26825  if (unlikely(Py_SIZE(x) < 0)) {
26826  goto raise_neg_overflow;
26827  }
26828 #else
26829  {
26830  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26831  if (unlikely(result < 0))
26832  return (int) -1;
26833  if (unlikely(result == 1))
26834  goto raise_neg_overflow;
26835  }
26836 #endif
26837  if (sizeof(int) <= sizeof(unsigned long)) {
26838  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
26839 #ifdef HAVE_LONG_LONG
26840  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
26841  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26842 #endif
26843  }
26844  } else {
26845 #if CYTHON_USE_PYLONG_INTERNALS
26846  const digit* digits = ((PyLongObject*)x)->ob_digit;
26847  switch (Py_SIZE(x)) {
26848  case 0: return (int) 0;
26849  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
26850  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
26851  case -2:
26852  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
26853  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26854  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26855  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26856  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26857  }
26858  }
26859  break;
26860  case 2:
26861  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26862  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26863  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26864  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26865  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26866  }
26867  }
26868  break;
26869  case -3:
26870  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26871  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26872  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26873  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26874  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26875  }
26876  }
26877  break;
26878  case 3:
26879  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26880  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26881  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26882  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26883  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26884  }
26885  }
26886  break;
26887  case -4:
26888  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26889  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26890  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26891  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
26892  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26893  }
26894  }
26895  break;
26896  case 4:
26897  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26898  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26899  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26900  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
26901  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26902  }
26903  }
26904  break;
26905  }
26906 #endif
26907  if (sizeof(int) <= sizeof(long)) {
26908  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
26909 #ifdef HAVE_LONG_LONG
26910  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
26911  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
26912 #endif
26913  }
26914  }
26915  {
26916 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26917  PyErr_SetString(PyExc_RuntimeError,
26918  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26919 #else
26920  int val;
26921  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
26922  #if PY_MAJOR_VERSION < 3
26923  if (likely(v) && !PyLong_Check(v)) {
26924  PyObject *tmp = v;
26925  v = PyNumber_Long(tmp);
26926  Py_DECREF(tmp);
26927  }
26928  #endif
26929  if (likely(v)) {
26930  int one = 1; int is_little = (int)*(unsigned char *)&one;
26931  unsigned char *bytes = (unsigned char *)&val;
26932  int ret = _PyLong_AsByteArray((PyLongObject *)v,
26933  bytes, sizeof(val),
26934  is_little, !is_unsigned);
26935  Py_DECREF(v);
26936  if (likely(!ret))
26937  return val;
26938  }
26939 #endif
26940  return (int) -1;
26941  }
26942  } else {
26943  int val;
26944  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26945  if (!tmp) return (int) -1;
26946  val = __Pyx_PyInt_As_int(tmp);
26947  Py_DECREF(tmp);
26948  return val;
26949  }
26950 raise_overflow:
26951  PyErr_SetString(PyExc_OverflowError,
26952  "value too large to convert to int");
26953  return (int) -1;
26954 raise_neg_overflow:
26955  PyErr_SetString(PyExc_OverflowError,
26956  "can't convert negative value to int");
26957  return (int) -1;
26958 }
26959 
26960 /* TypeInfoToFormat */
26961 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
26962  struct __pyx_typeinfo_string result = { {0} };
26963  char *buf = (char *) result.string;
26964  size_t size = type->size;
26965  switch (type->typegroup) {
26966  case 'H':
26967  *buf = 'c';
26968  break;
26969  case 'I':
26970  case 'U':
26971  if (size == 1)
26972  *buf = (type->is_unsigned) ? 'B' : 'b';
26973  else if (size == 2)
26974  *buf = (type->is_unsigned) ? 'H' : 'h';
26975  else if (size == 4)
26976  *buf = (type->is_unsigned) ? 'I' : 'i';
26977  else if (size == 8)
26978  *buf = (type->is_unsigned) ? 'Q' : 'q';
26979  break;
26980  case 'P':
26981  *buf = 'P';
26982  break;
26983  case 'C':
26984  {
26985  __Pyx_TypeInfo complex_type = *type;
26986  complex_type.typegroup = 'R';
26987  complex_type.size /= 2;
26988  *buf++ = 'Z';
26989  *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
26990  break;
26991  }
26992  case 'R':
26993  if (size == 4)
26994  *buf = 'f';
26995  else if (size == 8)
26996  *buf = 'd';
26997  else
26998  *buf = 'g';
26999  break;
27000  }
27001  return result;
27002 }
27003 
27004 /* MemviewSliceCopyTemplate */
27005 static __Pyx_memviewslice
27006 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
27007  const char *mode, int ndim,
27008  size_t sizeof_dtype, int contig_flag,
27009  int dtype_is_object)
27010 {
27011  __Pyx_RefNannyDeclarations
27012  int i;
27013  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27014  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27015  Py_buffer *buf = &from_memview->view;
27016  PyObject *shape_tuple = NULL;
27017  PyObject *temp_int = NULL;
27018  struct __pyx_array_obj *array_obj = NULL;
27019  struct __pyx_memoryview_obj *memview_obj = NULL;
27020  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
27021  for (i = 0; i < ndim; i++) {
27022  if (from_mvs->suboffsets[i] >= 0) {
27023  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
27024  "indirect dimensions (axis %d)", i);
27025  goto fail;
27026  }
27027  }
27028  shape_tuple = PyTuple_New(ndim);
27029  if (unlikely(!shape_tuple)) {
27030  goto fail;
27031  }
27032  __Pyx_GOTREF(shape_tuple);
27033  for(i = 0; i < ndim; i++) {
27034  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27035  if(unlikely(!temp_int)) {
27036  goto fail;
27037  } else {
27038  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27039  temp_int = NULL;
27040  }
27041  }
27042  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
27043  if (unlikely(!array_obj)) {
27044  goto fail;
27045  }
27046  __Pyx_GOTREF(array_obj);
27047  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27048  (PyObject *) array_obj, contig_flag,
27049  dtype_is_object,
27050  from_mvs->memview->typeinfo);
27051  if (unlikely(!memview_obj))
27052  goto fail;
27053  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27054  goto fail;
27055  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27056  dtype_is_object) < 0))
27057  goto fail;
27058  goto no_fail;
27059 fail:
27060  __Pyx_XDECREF(new_mvs.memview);
27061  new_mvs.memview = NULL;
27062  new_mvs.data = NULL;
27063 no_fail:
27064  __Pyx_XDECREF(shape_tuple);
27065  __Pyx_XDECREF(temp_int);
27066  __Pyx_XDECREF(array_obj);
27067  __Pyx_RefNannyFinishContext();
27068  return new_mvs;
27069 }
27070 
27071 /* MemviewSliceInit */
27072 static int
27073 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
27074  int ndim,
27075  __Pyx_memviewslice *memviewslice,
27076  int memview_is_new_reference)
27077 {
27078  __Pyx_RefNannyDeclarations
27079  int i, retval=-1;
27080  Py_buffer *buf = &memview->view;
27081  __Pyx_RefNannySetupContext("init_memviewslice", 0);
27082  if (memviewslice->memview || memviewslice->data) {
27083  PyErr_SetString(PyExc_ValueError,
27084  "memviewslice is already initialized!");
27085  goto fail;
27086  }
27087  if (buf->strides) {
27088  for (i = 0; i < ndim; i++) {
27089  memviewslice->strides[i] = buf->strides[i];
27090  }
27091  } else {
27092  Py_ssize_t stride = buf->itemsize;
27093  for (i = ndim - 1; i >= 0; i--) {
27094  memviewslice->strides[i] = stride;
27095  stride *= buf->shape[i];
27096  }
27097  }
27098  for (i = 0; i < ndim; i++) {
27099  memviewslice->shape[i] = buf->shape[i];
27100  if (buf->suboffsets) {
27101  memviewslice->suboffsets[i] = buf->suboffsets[i];
27102  } else {
27103  memviewslice->suboffsets[i] = -1;
27104  }
27105  }
27106  memviewslice->memview = memview;
27107  memviewslice->data = (char *)buf->buf;
27108  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
27109  Py_INCREF(memview);
27110  }
27111  retval = 0;
27112  goto no_fail;
27113 fail:
27114  memviewslice->memview = 0;
27115  memviewslice->data = 0;
27116  retval = -1;
27117 no_fail:
27118  __Pyx_RefNannyFinishContext();
27119  return retval;
27120 }
27121 #ifndef Py_NO_RETURN
27122 #define Py_NO_RETURN
27123 #endif
27124 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
27125  va_list vargs;
27126  char msg[200];
27127 #ifdef HAVE_STDARG_PROTOTYPES
27128  va_start(vargs, fmt);
27129 #else
27130  va_start(vargs);
27131 #endif
27132  vsnprintf(msg, 200, fmt, vargs);
27133  va_end(vargs);
27134  Py_FatalError(msg);
27135 }
27136 static CYTHON_INLINE int
27137 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
27138  PyThread_type_lock lock)
27139 {
27140  int result;
27141  PyThread_acquire_lock(lock, 1);
27142  result = (*acquisition_count)++;
27143  PyThread_release_lock(lock);
27144  return result;
27145 }
27146 static CYTHON_INLINE int
27147 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
27148  PyThread_type_lock lock)
27149 {
27150  int result;
27151  PyThread_acquire_lock(lock, 1);
27152  result = (*acquisition_count)--;
27153  PyThread_release_lock(lock);
27154  return result;
27155 }
27156 static CYTHON_INLINE void
27157 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
27158 {
27159  int first_time;
27160  struct __pyx_memoryview_obj *memview = memslice->memview;
27161  if (!memview || (PyObject *) memview == Py_None)
27162  return;
27163  if (__pyx_get_slice_count(memview) < 0)
27164  __pyx_fatalerror("Acquisition count is %d (line %d)",
27165  __pyx_get_slice_count(memview), lineno);
27166  first_time = __pyx_add_acquisition_count(memview) == 0;
27167  if (first_time) {
27168  if (have_gil) {
27169  Py_INCREF((PyObject *) memview);
27170  } else {
27171  PyGILState_STATE _gilstate = PyGILState_Ensure();
27172  Py_INCREF((PyObject *) memview);
27173  PyGILState_Release(_gilstate);
27174  }
27175  }
27176 }
27177 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
27178  int have_gil, int lineno) {
27179  int last_time;
27180  struct __pyx_memoryview_obj *memview = memslice->memview;
27181  if (!memview ) {
27182  return;
27183  } else if ((PyObject *) memview == Py_None) {
27184  memslice->memview = NULL;
27185  return;
27186  }
27187  if (__pyx_get_slice_count(memview) <= 0)
27188  __pyx_fatalerror("Acquisition count is %d (line %d)",
27189  __pyx_get_slice_count(memview), lineno);
27190  last_time = __pyx_sub_acquisition_count(memview) == 1;
27191  memslice->data = NULL;
27192  if (last_time) {
27193  if (have_gil) {
27194  Py_CLEAR(memslice->memview);
27195  } else {
27196  PyGILState_STATE _gilstate = PyGILState_Ensure();
27197  Py_CLEAR(memslice->memview);
27198  PyGILState_Release(_gilstate);
27199  }
27200  } else {
27201  memslice->memview = NULL;
27202  }
27203 }
27204 
27205 /* CIntFromPy */
27206 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
27207  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
27208  const int is_unsigned = neg_one > const_zero;
27209 #if PY_MAJOR_VERSION < 3
27210  if (likely(PyInt_Check(x))) {
27211  if (sizeof(long) < sizeof(long)) {
27212  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
27213  } else {
27214  long val = PyInt_AS_LONG(x);
27215  if (is_unsigned && unlikely(val < 0)) {
27216  goto raise_neg_overflow;
27217  }
27218  return (long) val;
27219  }
27220  } else
27221 #endif
27222  if (likely(PyLong_Check(x))) {
27223  if (is_unsigned) {
27224 #if CYTHON_USE_PYLONG_INTERNALS
27225  const digit* digits = ((PyLongObject*)x)->ob_digit;
27226  switch (Py_SIZE(x)) {
27227  case 0: return (long) 0;
27228  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
27229  case 2:
27230  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27231  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27232  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27233  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
27234  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27235  }
27236  }
27237  break;
27238  case 3:
27239  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27240  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27241  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27242  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
27243  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27244  }
27245  }
27246  break;
27247  case 4:
27248  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27249  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27250  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27251  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
27252  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27253  }
27254  }
27255  break;
27256  }
27257 #endif
27258 #if CYTHON_COMPILING_IN_CPYTHON
27259  if (unlikely(Py_SIZE(x) < 0)) {
27260  goto raise_neg_overflow;
27261  }
27262 #else
27263  {
27264  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27265  if (unlikely(result < 0))
27266  return (long) -1;
27267  if (unlikely(result == 1))
27268  goto raise_neg_overflow;
27269  }
27270 #endif
27271  if (sizeof(long) <= sizeof(unsigned long)) {
27272  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
27273 #ifdef HAVE_LONG_LONG
27274  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27275  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27276 #endif
27277  }
27278  } else {
27279 #if CYTHON_USE_PYLONG_INTERNALS
27280  const digit* digits = ((PyLongObject*)x)->ob_digit;
27281  switch (Py_SIZE(x)) {
27282  case 0: return (long) 0;
27283  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
27284  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
27285  case -2:
27286  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
27287  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27288  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27289  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27290  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27291  }
27292  }
27293  break;
27294  case 2:
27295  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27296  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27297  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27298  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27299  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27300  }
27301  }
27302  break;
27303  case -3:
27304  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27305  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27306  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27307  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27308  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27309  }
27310  }
27311  break;
27312  case 3:
27313  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27314  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27315  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27316  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27317  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27318  }
27319  }
27320  break;
27321  case -4:
27322  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27323  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27324  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27325  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27326  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27327  }
27328  }
27329  break;
27330  case 4:
27331  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27332  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27333  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27334  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27335  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27336  }
27337  }
27338  break;
27339  }
27340 #endif
27341  if (sizeof(long) <= sizeof(long)) {
27342  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
27343 #ifdef HAVE_LONG_LONG
27344  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27345  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
27346 #endif
27347  }
27348  }
27349  {
27350 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27351  PyErr_SetString(PyExc_RuntimeError,
27352  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27353 #else
27354  long val;
27355  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27356  #if PY_MAJOR_VERSION < 3
27357  if (likely(v) && !PyLong_Check(v)) {
27358  PyObject *tmp = v;
27359  v = PyNumber_Long(tmp);
27360  Py_DECREF(tmp);
27361  }
27362  #endif
27363  if (likely(v)) {
27364  int one = 1; int is_little = (int)*(unsigned char *)&one;
27365  unsigned char *bytes = (unsigned char *)&val;
27366  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27367  bytes, sizeof(val),
27368  is_little, !is_unsigned);
27369  Py_DECREF(v);
27370  if (likely(!ret))
27371  return val;
27372  }
27373 #endif
27374  return (long) -1;
27375  }
27376  } else {
27377  long val;
27378  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27379  if (!tmp) return (long) -1;
27380  val = __Pyx_PyInt_As_long(tmp);
27381  Py_DECREF(tmp);
27382  return val;
27383  }
27384 raise_overflow:
27385  PyErr_SetString(PyExc_OverflowError,
27386  "value too large to convert to long");
27387  return (long) -1;
27388 raise_neg_overflow:
27389  PyErr_SetString(PyExc_OverflowError,
27390  "can't convert negative value to long");
27391  return (long) -1;
27392 }
27393 
27394 /* CIntToPy */
27395 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
27396  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
27397  const int is_unsigned = neg_one > const_zero;
27398  if (is_unsigned) {
27399  if (sizeof(long) < sizeof(long)) {
27400  return PyInt_FromLong((long) value);
27401  } else if (sizeof(long) <= sizeof(unsigned long)) {
27402  return PyLong_FromUnsignedLong((unsigned long) value);
27403 #ifdef HAVE_LONG_LONG
27404  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27405  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27406 #endif
27407  }
27408  } else {
27409  if (sizeof(long) <= sizeof(long)) {
27410  return PyInt_FromLong((long) value);
27411 #ifdef HAVE_LONG_LONG
27412  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27413  return PyLong_FromLongLong((PY_LONG_LONG) value);
27414 #endif
27415  }
27416  }
27417  {
27418  int one = 1; int little = (int)*(unsigned char *)&one;
27419  unsigned char *bytes = (unsigned char *)&value;
27420  return _PyLong_FromByteArray(bytes, sizeof(long),
27421  little, !is_unsigned);
27422  }
27423 }
27424 
27425 /* CIntFromPy */
27426 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
27427  const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
27428  const int is_unsigned = neg_one > const_zero;
27429 #if PY_MAJOR_VERSION < 3
27430  if (likely(PyInt_Check(x))) {
27431  if (sizeof(char) < sizeof(long)) {
27432  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
27433  } else {
27434  long val = PyInt_AS_LONG(x);
27435  if (is_unsigned && unlikely(val < 0)) {
27436  goto raise_neg_overflow;
27437  }
27438  return (char) val;
27439  }
27440  } else
27441 #endif
27442  if (likely(PyLong_Check(x))) {
27443  if (is_unsigned) {
27444 #if CYTHON_USE_PYLONG_INTERNALS
27445  const digit* digits = ((PyLongObject*)x)->ob_digit;
27446  switch (Py_SIZE(x)) {
27447  case 0: return (char) 0;
27448  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
27449  case 2:
27450  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27451  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27452  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27453  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
27454  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27455  }
27456  }
27457  break;
27458  case 3:
27459  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27460  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27461  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27462  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
27463  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27464  }
27465  }
27466  break;
27467  case 4:
27468  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27469  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27470  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27471  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
27472  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27473  }
27474  }
27475  break;
27476  }
27477 #endif
27478 #if CYTHON_COMPILING_IN_CPYTHON
27479  if (unlikely(Py_SIZE(x) < 0)) {
27480  goto raise_neg_overflow;
27481  }
27482 #else
27483  {
27484  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27485  if (unlikely(result < 0))
27486  return (char) -1;
27487  if (unlikely(result == 1))
27488  goto raise_neg_overflow;
27489  }
27490 #endif
27491  if (sizeof(char) <= sizeof(unsigned long)) {
27492  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
27493 #ifdef HAVE_LONG_LONG
27494  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
27495  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27496 #endif
27497  }
27498  } else {
27499 #if CYTHON_USE_PYLONG_INTERNALS
27500  const digit* digits = ((PyLongObject*)x)->ob_digit;
27501  switch (Py_SIZE(x)) {
27502  case 0: return (char) 0;
27503  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
27504  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
27505  case -2:
27506  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
27507  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27508  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27509  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27510  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27511  }
27512  }
27513  break;
27514  case 2:
27515  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27516  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27517  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27518  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27519  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27520  }
27521  }
27522  break;
27523  case -3:
27524  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27525  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27526  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27527  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27528  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27529  }
27530  }
27531  break;
27532  case 3:
27533  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27534  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27535  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27536  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27537  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27538  }
27539  }
27540  break;
27541  case -4:
27542  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27543  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27544  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27545  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27546  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27547  }
27548  }
27549  break;
27550  case 4:
27551  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27552  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27553  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27554  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27555  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27556  }
27557  }
27558  break;
27559  }
27560 #endif
27561  if (sizeof(char) <= sizeof(long)) {
27562  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
27563 #ifdef HAVE_LONG_LONG
27564  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
27565  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
27566 #endif
27567  }
27568  }
27569  {
27570 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27571  PyErr_SetString(PyExc_RuntimeError,
27572  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27573 #else
27574  char val;
27575  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27576  #if PY_MAJOR_VERSION < 3
27577  if (likely(v) && !PyLong_Check(v)) {
27578  PyObject *tmp = v;
27579  v = PyNumber_Long(tmp);
27580  Py_DECREF(tmp);
27581  }
27582  #endif
27583  if (likely(v)) {
27584  int one = 1; int is_little = (int)*(unsigned char *)&one;
27585  unsigned char *bytes = (unsigned char *)&val;
27586  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27587  bytes, sizeof(val),
27588  is_little, !is_unsigned);
27589  Py_DECREF(v);
27590  if (likely(!ret))
27591  return val;
27592  }
27593 #endif
27594  return (char) -1;
27595  }
27596  } else {
27597  char val;
27598  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27599  if (!tmp) return (char) -1;
27600  val = __Pyx_PyInt_As_char(tmp);
27601  Py_DECREF(tmp);
27602  return val;
27603  }
27604 raise_overflow:
27605  PyErr_SetString(PyExc_OverflowError,
27606  "value too large to convert to char");
27607  return (char) -1;
27608 raise_neg_overflow:
27609  PyErr_SetString(PyExc_OverflowError,
27610  "can't convert negative value to char");
27611  return (char) -1;
27612 }
27613 
27614 /* CheckBinaryVersion */
27615 static int __Pyx_check_binary_version(void) {
27616  char ctversion[4], rtversion[4];
27617  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
27618  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
27619  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
27620  char message[200];
27621  PyOS_snprintf(message, sizeof(message),
27622  "compiletime version %s of module '%.100s' "
27623  "does not match runtime version %s",
27624  ctversion, __Pyx_MODULE_NAME, rtversion);
27625  return PyErr_WarnEx(NULL, message, 1);
27626  }
27627  return 0;
27628 }
27629 
27630 /* InitStrings */
27631 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
27632  while (t->p) {
27633  #if PY_MAJOR_VERSION < 3
27634  if (t->is_unicode) {
27635  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
27636  } else if (t->intern) {
27637  *t->p = PyString_InternFromString(t->s);
27638  } else {
27639  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
27640  }
27641  #else
27642  if (t->is_unicode | t->is_str) {
27643  if (t->intern) {
27644  *t->p = PyUnicode_InternFromString(t->s);
27645  } else if (t->encoding) {
27646  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
27647  } else {
27648  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
27649  }
27650  } else {
27651  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
27652  }
27653  #endif
27654  if (!*t->p)
27655  return -1;
27656  if (PyObject_Hash(*t->p) == -1)
27657  return -1;
27658  ++t;
27659  }
27660  return 0;
27661 }
27662 
27663 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
27664  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
27665 }
27666 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
27667  Py_ssize_t ignore;
27668  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
27669 }
27670 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27671 #if !CYTHON_PEP393_ENABLED
27672 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27673  char* defenc_c;
27674  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
27675  if (!defenc) return NULL;
27676  defenc_c = PyBytes_AS_STRING(defenc);
27677 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27678  {
27679  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
27680  char* c;
27681  for (c = defenc_c; c < end; c++) {
27682  if ((unsigned char) (*c) >= 128) {
27683  PyUnicode_AsASCIIString(o);
27684  return NULL;
27685  }
27686  }
27687  }
27688 #endif
27689  *length = PyBytes_GET_SIZE(defenc);
27690  return defenc_c;
27691 }
27692 #else
27693 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27694  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
27695 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27696  if (likely(PyUnicode_IS_ASCII(o))) {
27697  *length = PyUnicode_GET_LENGTH(o);
27698  return PyUnicode_AsUTF8(o);
27699  } else {
27700  PyUnicode_AsASCIIString(o);
27701  return NULL;
27702  }
27703 #else
27704  return PyUnicode_AsUTF8AndSize(o, length);
27705 #endif
27706 }
27707 #endif
27708 #endif
27709 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27710 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27711  if (
27712 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27713  __Pyx_sys_getdefaultencoding_not_ascii &&
27714 #endif
27715  PyUnicode_Check(o)) {
27716  return __Pyx_PyUnicode_AsStringAndSize(o, length);
27717  } else
27718 #endif
27719 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
27720  if (PyByteArray_Check(o)) {
27721  *length = PyByteArray_GET_SIZE(o);
27722  return PyByteArray_AS_STRING(o);
27723  } else
27724 #endif
27725  {
27726  char* result;
27727  int r = PyBytes_AsStringAndSize(o, &result, length);
27728  if (unlikely(r < 0)) {
27729  return NULL;
27730  } else {
27731  return result;
27732  }
27733  }
27734 }
27735 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
27736  int is_true = x == Py_True;
27737  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
27738  else return PyObject_IsTrue(x);
27739 }
27740 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
27741  int retval;
27742  if (unlikely(!x)) return -1;
27743  retval = __Pyx_PyObject_IsTrue(x);
27744  Py_DECREF(x);
27745  return retval;
27746 }
27747 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
27748 #if PY_MAJOR_VERSION >= 3
27749  if (PyLong_Check(result)) {
27750  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
27751  "__int__ returned non-int (type %.200s). "
27752  "The ability to return an instance of a strict subclass of int "
27753  "is deprecated, and may be removed in a future version of Python.",
27754  Py_TYPE(result)->tp_name)) {
27755  Py_DECREF(result);
27756  return NULL;
27757  }
27758  return result;
27759  }
27760 #endif
27761  PyErr_Format(PyExc_TypeError,
27762  "__%.4s__ returned non-%.4s (type %.200s)",
27763  type_name, type_name, Py_TYPE(result)->tp_name);
27764  Py_DECREF(result);
27765  return NULL;
27766 }
27767 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
27768 #if CYTHON_USE_TYPE_SLOTS
27769  PyNumberMethods *m;
27770 #endif
27771  const char *name = NULL;
27772  PyObject *res = NULL;
27773 #if PY_MAJOR_VERSION < 3
27774  if (likely(PyInt_Check(x) || PyLong_Check(x)))
27775 #else
27776  if (likely(PyLong_Check(x)))
27777 #endif
27778  return __Pyx_NewRef(x);
27779 #if CYTHON_USE_TYPE_SLOTS
27780  m = Py_TYPE(x)->tp_as_number;
27781  #if PY_MAJOR_VERSION < 3
27782  if (m && m->nb_int) {
27783  name = "int";
27784  res = m->nb_int(x);
27785  }
27786  else if (m && m->nb_long) {
27787  name = "long";
27788  res = m->nb_long(x);
27789  }
27790  #else
27791  if (likely(m && m->nb_int)) {
27792  name = "int";
27793  res = m->nb_int(x);
27794  }
27795  #endif
27796 #else
27797  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
27798  res = PyNumber_Int(x);
27799  }
27800 #endif
27801  if (likely(res)) {
27802 #if PY_MAJOR_VERSION < 3
27803  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
27804 #else
27805  if (unlikely(!PyLong_CheckExact(res))) {
27806 #endif
27807  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
27808  }
27809  }
27810  else if (!PyErr_Occurred()) {
27811  PyErr_SetString(PyExc_TypeError,
27812  "an integer is required");
27813  }
27814  return res;
27815 }
27816 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
27817  Py_ssize_t ival;
27818  PyObject *x;
27819 #if PY_MAJOR_VERSION < 3
27820  if (likely(PyInt_CheckExact(b))) {
27821  if (sizeof(Py_ssize_t) >= sizeof(long))
27822  return PyInt_AS_LONG(b);
27823  else
27824  return PyInt_AsSsize_t(b);
27825  }
27826 #endif
27827  if (likely(PyLong_CheckExact(b))) {
27828  #if CYTHON_USE_PYLONG_INTERNALS
27829  const digit* digits = ((PyLongObject*)b)->ob_digit;
27830  const Py_ssize_t size = Py_SIZE(b);
27831  if (likely(__Pyx_sst_abs(size) <= 1)) {
27832  ival = likely(size) ? digits[0] : 0;
27833  if (size == -1) ival = -ival;
27834  return ival;
27835  } else {
27836  switch (size) {
27837  case 2:
27838  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27839  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27840  }
27841  break;
27842  case -2:
27843  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27844  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27845  }
27846  break;
27847  case 3:
27848  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27849  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27850  }
27851  break;
27852  case -3:
27853  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27854  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27855  }
27856  break;
27857  case 4:
27858  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27859  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27860  }
27861  break;
27862  case -4:
27863  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27864  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27865  }
27866  break;
27867  }
27868  }
27869  #endif
27870  return PyLong_AsSsize_t(b);
27871  }
27872  x = PyNumber_Index(b);
27873  if (!x) return -1;
27874  ival = PyInt_AsSsize_t(x);
27875  Py_DECREF(x);
27876  return ival;
27877 }
27878 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
27879  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
27880 }
27881 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
27882  return PyInt_FromSize_t(ival);
27883 }
27884 
27885 
27886 #endif /* Py_PYTHON_H */
Double c
Definition: Headers.h:53
double sigmaMax
Definition: mesh.h:70
int * elementBoundaryNodesArray
Definition: mesh.h:42
int nInteriorElementBoundaries_global
Definition: mesh.h:30
int nx
Definition: mesh.h:63
int * nodeElementOffsets
Definition: mesh.h:42
Double f
Definition: Headers.h:53
double pos(double a)
double * weights
Definition: mesh.h:61
int * exteriorElementBoundariesArray
Definition: mesh.h:42
Double * z
Definition: Headers.h:40
int buildQuadraticCubeSubdomain2GlobalMappings_3d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *edgeOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *edgeNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
int partitionElements(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, int nElements_overlap)
int * interiorElementBoundariesArray
Definition: mesh.h:42
int nNodes_element
Definition: mesh.h:30
int * edgeNodesArray
Definition: mesh.h:42
double * nodeArray
Definition: mesh.h:67
Int n
Definition: Headers.h:27
double * nodeDiametersArray
Definition: mesh.h:69
double volume
Definition: mesh.h:70
int buildQuadraticSubdomain2GlobalMappings_1d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *elementNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Double s
Definition: Headers.h:53
double hMin
Definition: mesh.h:70
int buildQuadraticSubdomain2GlobalMappings_2d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementBoundaryOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *elementBoundaryNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
int pz
Definition: mesh.h:64
double * elementBoundaryBarycentersArray
Definition: mesh.h:68
int nElementBoundaries_element
Definition: mesh.h:30
int ny
Definition: mesh.h:63
int buildQuadraticSubdomain2GlobalMappings_3d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *edgeOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *edgeNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
int px
Definition: mesh.h:64
int * nodeStarOffsets
Definition: mesh.h:42
double h
Definition: mesh.h:70
int max_nNodeNeighbors_node
Definition: mesh.h:30
int nNodes_elementBoundary
Definition: mesh.h:30
int * elementBoundaryMaterialTypes
Definition: mesh.h:42
int nEdges_global
Definition: mesh.h:30
Double u
Definition: Headers.h:53
int nElementBoundaries_global
Definition: mesh.h:30
double * elementBarycentersArray
Definition: mesh.h:68
double * elementInnerDiametersArray
Definition: mesh.h:67
int * elementBoundariesArray
Definition: mesh.h:42
int nElements_global
Definition: mesh.h:30
Definition: mesh.h:27
int * elementMaterialTypes
Definition: mesh.h:42
int * elementBoundaryLocalElementBoundariesArray
Definition: mesh.h:42
int partitionNodesFromTetgenFiles(const MPI_Comm &PROTEUS_COMM_WORLD, const char *filebase, int indexBase, Mesh &newMesh, int nNodes_overlap)
double * W_KNOT
Definition: mesh.h:62
int partitionNodes(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, int nNodes_overlap)
int * nodeStarArray
Definition: mesh.h:42
Double L
Definition: Headers.h:53
int py
Definition: mesh.h:64
int nNodes_global
Definition: mesh.h:30
double * elementBoundaryDiametersArray
Definition: mesh.h:67
int nz
Definition: mesh.h:63
double * U_KNOT
Definition: mesh.h:62
double * V_KNOT
Definition: mesh.h:62
double * elementDiametersArray
Definition: mesh.h:67
int * nodeMaterialTypes
Definition: mesh.h:42
double * nodeSupportArray
Definition: mesh.h:69
int * nodeElementsArray
Definition: mesh.h:42
int * elementNodesArray
Definition: mesh.h:42
int * elementBoundaryElementsArray
Definition: mesh.h:42
Double q
Definition: Headers.h:53
int nExteriorElementBoundaries_global
Definition: mesh.h:30
int max_nElements_node
Definition: mesh.h:30
int buildDiscontinuousGalerkinSubdomain2GlobalMappings(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementOffsets_subdomain_owned, const int *elementNumbering_subdomain2global, int nDOF_element, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global)
Double v
Definition: Headers.h:53
Double r
Definition: Headers.h:53
Double T
Definition: Headers.h:53
int * elementNeighborsArray
Definition: mesh.h:42
Double U
Definition: Headers.h:53
int * elementIJK
Definition: mesh.h:60